Examples of Paragraph


Examples of com.lowagie.text.Paragraph

            c.setBackgroundColor(img.getBackgroundColor());
            t.addCell(c);
            element = t;
        }
        if (element.type() == Element.CHUNK) {
          element = new Paragraph((Chunk)element);
        }
        else if (element.type() == Element.PHRASE) {
          element = new Paragraph((Phrase)element);
        }
        if (element instanceof SimpleTable) {
          try {
        element = ((SimpleTable)element).createPdfPTable();
      } catch (DocumentException e) {
View Full Code Here

Examples of com.lowagie.text.Paragraph

        while (true) {
            if (compositeElements.isEmpty())
                return NO_MORE_TEXT;
            Element element = (Element)compositeElements.getFirst();
            if (element.type() == Element.PARAGRAPH) {
                Paragraph para = (Paragraph)element;
                int status = 0;
                for (int keep = 0; keep < 2; ++keep) {
                    float lastY = yLine;
                    boolean createHere = false;
                    if (compositeColumn == null) {
                        compositeColumn = new ColumnText(canvas);
                        compositeColumn.setUseAscender(firstPass ? useAscender : false);
                        compositeColumn.setAlignment(para.getAlignment());
                        compositeColumn.setIndent(para.getIndentationLeft() + para.getFirstLineIndent());
                        compositeColumn.setExtraParagraphSpace(para.getExtraParagraphSpace());
                        compositeColumn.setFollowingIndent(para.getIndentationLeft());
                        compositeColumn.setRightIndent(para.getIndentationRight());
                        compositeColumn.setLeading(para.getLeading(), para.getMultipliedLeading());
                        compositeColumn.setRunDirection(runDirection);
                        compositeColumn.setArabicOptions(arabicOptions);
                        compositeColumn.setSpaceCharRatio(spaceCharRatio);
                        compositeColumn.addText(para);
                        if (!firstPass) {
                            yLine -= para.spacingBefore();
                        }
                        createHere = true;
                    }
                    compositeColumn.leftX = leftX;
                    compositeColumn.rightX = rightX;
                    compositeColumn.yLine = yLine;
                    compositeColumn.rectangularWidth = rectangularWidth;
                    compositeColumn.rectangularMode = rectangularMode;
                    compositeColumn.minY = minY;
                    compositeColumn.maxY = maxY;
                    boolean keepCandidate = (para.getKeepTogether() && createHere && !firstPass);
                    status = compositeColumn.go(simulate || (keepCandidate && keep == 0));
                    updateFilledWidth(compositeColumn.filledWidth);
                    if ((status & NO_MORE_TEXT) == 0 && keepCandidate) {
                        compositeColumn = null;
                        yLine = lastY;
                        return NO_MORE_COLUMN;
                    }
                    if (simulate || !keepCandidate)
                        break;
                    if (keep == 0) {
                        compositeColumn = null;
                        yLine = lastY;
                    }
                }
                firstPass = false;
                yLine = compositeColumn.yLine;
                linesWritten += compositeColumn.linesWritten;
                descender = compositeColumn.descender;
                if ((status & NO_MORE_TEXT) != 0) {
                    compositeColumn = null;
                    compositeElements.removeFirst();
                    yLine -= para.spacingAfter();
                }
                if ((status & NO_MORE_COLUMN) != 0) {
                    return NO_MORE_COLUMN;
                }
            }
View Full Code Here

Examples of com.lowagie.text.Paragraph

        }
        context.pop();
        final StyleContext cellContext = getCurrentContext();
        cellContext.add(currentContext.getTarget());

        context.push(new StyleContext(new Paragraph(), text.getStyleSheet(), metaData));
      }
    }
  }
View Full Code Here

Examples of com.lowagie.text.Paragraph

  }

  protected void processParagraphChilds(final ParagraphRenderBox box)
  {
    context.push(new StyleContext(new Paragraph(), box.getStyleSheet(), metaData));
    clearText();

    super.processParagraphChilds(box);

    final StyleContext currentContext = getCurrentContext();
View Full Code Here

Examples of com.lowagie.text.Paragraph

  }

    private void addColumnValue(PdfPTable pdfTable, UIComponent component, int index, Font font) {
      String value = component == null ? "" : ComponentUtils.getStringValueToRender(FacesContext.getCurrentInstance(), component);
           
        pdfTable.addCell(new Paragraph(value, font));
    }
View Full Code Here

Examples of com.lowagie.text.Paragraph

                if(value != null)
                  buffer.append(value);
            }
    } 
       
        pdfTable.addCell(new Paragraph(buffer.toString(), font));
    }
View Full Code Here

Examples of com.lowagie.text.Paragraph

  static PdfPCell borderlessCell(String s){
      PdfPCell cell = new PdfPCell();
      Font f = new Font(Font.COURIER);
      cell.setBorder(0);
      cell.setHorizontalAlignment(Element.ALIGN_LEFT);
      cell.addElement(new Paragraph(s,f));
      return cell;
  }
View Full Code Here

Examples of com.lowagie.text.Paragraph

      return cell;
  }
  public static void addEmptyLine(Paragraph p,int line)
  {
    for( int i=0; i < line; i++ )
        p.add( new Paragraph(" ---------------------------------------") );
   
   
   
  }
View Full Code Here

Examples of com.lowagie.text.Paragraph

          cb.endText();   
        }
   public static void addText( String text, Document doc, Font font, int newLines )
        throws DocumentException
        {
          Paragraph paragraph = new Paragraph( text, font );
          addEmptyLine( paragraph, newLines );
          doc.add( paragraph )
        }
View Full Code Here

Examples of com.lowagie.text.Paragraph

//          headerTable.addCell(borderlessCell("Phone Number"));
//          headerTable.addCell(borderlessCell(c.getPhone()));
          doc.add(headerTable);
//              Phrase phrase = new Phrase(50);
//              doc.add(phrase);
          Paragraph paragraph = new Paragraph( "");
          main.addEmptyLine(paragraph,10);
         paragraph.add(CONNECT);
          doc.add( paragraph )
         
//          Chunk c = new Chunk( text, font );
//          c.setAction( new PdfAction( new URL( url ) ) );
//          c.setUnderline(0.8f, -0.8f);
//          doc.add( c );
         
         
         
         
          PdfPTable tab=new PdfPTable(6);
        PdfPCell cell = new PdfPCell(new Paragraph("Process Details"));
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setBackgroundColor(new Color(20,105,160));
        cell.setColspan(6);
        tab.addCell(cell);
        tab.addCell("id");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.