Package com.lowagie.text

Examples of com.lowagie.text.Paragraph


    }

    public static void createFirstPage(Document document,
                                       String currentDate,
                                       DrlPackageParser packageData) throws DocumentException {
        Paragraph title = new Paragraph( "\n\n\n\n\n" + packageData.getName().toUpperCase(),
                                         RULE_PACKAGE_TITLE );
        title.setAlignment( Element.ALIGN_CENTER );
        document.add( title );

        Paragraph date = new Paragraph( "Documentation created: " + currentDate,
                                        BODY_TEXT );
        date.setAlignment( Element.ALIGN_CENTER );
        document.add( date );

        document.add( new Paragraph( "\n\n\n\n\n" + packageData.getDescription(),
                                     BODY_TEXT ) );
        document.add( newTable( "Metadata ",
                                packageData.getMetadata() ) );
        document.add( newTable( "Globals ",
                                packageData.getGlobals() ) );
View Full Code Here


                    // not really a question; ingore completely
                } else {
                    value = surveyResponseAnswer.getString("textResponse");
                }
                Chunk chunk = new Chunk(surveyQuestion.getString("question") + ": " + value);
                Paragraph p = new Paragraph(chunk);
                document.add(p);
            }
            ByteBuffer outByteBuffer = ByteBuffer.wrap(baos.toByteArray());
            results.put("outByteBuffer", outByteBuffer);
        } catch (GenericEntityException e) {
View Full Code Here

        // does it have column composite info?
        java.util.List compositeElements = cell.getCompositeElements();
        if(compositeElements != null) {
          Iterator cellIterator = compositeElements.iterator();
          // does it have column info?
          Paragraph container = null;
          while(cellIterator.hasNext()) {
              try {
                  Element element = (Element) cellIterator.next();
                  // should we wrap it in a paragraph
                  if(!(element instanceof Paragraph) && !(element instanceof List)) {
                      if(container != null) {
                          container.add(element);
                      } else {
                          container = new Paragraph();
                          container.setAlignment(cell.getHorizontalAlignment());
                          container.add(element);
                      }
                  } else {
                      if(container != null) {
                          RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(container);
                          for(int i = 0; i < rtfElements.length; i++) {
View Full Code Here

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

        context.push(new StyleContext(new Paragraph(), text.getStyleSheet(), metaData));
      }
    }
    else if (node.getNodeType() == LayoutNodeTypes.TYPE_NODE_COMPLEX_TEXT)
    {
      // todo: check if special text processing is required for RenderableComplexText nodes
//      return;
      if (node.isVirtualNode())
      {
        return;
      }

      if ((node.getX() + node.getWidth()) > (paragraphBounds.getX() + paragraphBounds.getWidth()))
      {
        // This node will only be partially visible. The end-of-line marker will not apply.
        return;
      }
      final RenderableComplexText text = (RenderableComplexText) node;
      if (text.isForceLinebreak())
      {
        final StyleContext currentContext = getCurrentContext();
        if (getTextLength() > 0)
        {
          currentContext.add(getText());
          clearText();
        }
        context.pop();
        final StyleContext cellContext = getCurrentContext();
        cellContext.add(currentContext.getTarget());

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

  }

  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

        }
       
        this.cellPadding = (int) this.parentRow.getParentTable().getCellPadding();
       
        Iterator cellIterator = cell.getElements();
        Paragraph container = null;
        while(cellIterator.hasNext()) {
            try {
                Element element = (Element) cellIterator.next();
                // should we wrap it in a paragraph
                if(!(element instanceof Paragraph) && !(element instanceof List)) {
                    if(container != null) {
                        container.add(element);
                    } else {
                        container = new Paragraph();
                        container.setAlignment(cell.getHorizontalAlignment());
                        container.add(element);
                    }
                } else {
                    if(container != null) {
                        RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(container);
                        for(int i = 0; i < rtfElements.length; i++) {
View Full Code Here

        Rectangle a4quer = new Rectangle(PageSize.A3.getHeight(), PageSize.A3.getWidth());
        PdfWriter.getInstance(document, out);
        document.setPageSize(a4quer);
        document.open();
        if (rowList.size() > 0) {
          Paragraph p = new Paragraph(rowList.get(0).get(0).toString());

          document.add(p);
          PdfPTable table = new PdfPTable(9);
          table.setSpacingBefore(20);
          for (int i = 1; i < rowList.size(); i++) {
View Full Code Here

    public static void newRulePage(Document document,
                                   String packageName,
                                   DrlRuleParser drlData) throws DocumentException {

        document.add( new Paragraph( packageName,
                                     PACKAGE_NAME ) );
        document.add( new Paragraph( "Rule " + drlData.getName(),
                                     CHAPTER_TITLE ) );

        // Extends
        int index = drlData.getName().lastIndexOf( "extends" );
        if ( index > 0 ) {
            document.add( new Paragraph( "Extends:",
                                         BODY_TEXT ) );

            Paragraph ext = new Paragraph( drlData.getName().substring( "extends".length() + index ),
                                           BODY_TEXT );
            ext.setIndentationLeft( INTENTATION_LEFT );
            document.add( ext );
        }

        // Description
        document.add( newDescription( drlData.getDescription() ) );
View Full Code Here

    }

    public static void createFirstPage(Document document,
                                       String currentDate,
                                       DrlPackageParser packageData) throws DocumentException {
        Paragraph title = new Paragraph( "\n\n\n\n\n" + packageData.getName().toUpperCase(),
                                         RULE_PACKAGE_TITLE );
        title.setAlignment( Element.ALIGN_CENTER );
        document.add( title );

        Paragraph date = new Paragraph( "Documentation created: " + currentDate,
                                        BODY_TEXT );
        date.setAlignment( Element.ALIGN_CENTER );
        document.add( date );

        document.add( new Paragraph( "\n\n\n\n\n" + packageData.getDescription(),
                                     BODY_TEXT ) );
        document.add( newTable( "Meta Data ",
                                packageData.getMetadata() ) );
        document.add( newTable( "Globals ",
                                packageData.getGlobals() ) );
View Full Code Here

      }
    }
  }

  public static Paragraph createParagraph(ChainedProperties props) {
    Paragraph p = new Paragraph();
    createParagraph(p, props);
    return p;
  }
View Full Code Here

TOP

Related Classes of com.lowagie.text.Paragraph

Copyright © 2018 www.massapicom. 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.