Package com.lowagie.text

Examples of com.lowagie.text.Phrase


      logger.error(Tools.getStackTrace(e));
    }
   
      // headers and footers must be added before the document is opened
        HeaderFooter footer = new HeaderFooter(
                    new Phrase("Pagina n�mero: ", new Font(bf)), true);
        footer.setBorder(Rectangle.NO_BORDER);
        footer.setAlignment(Element.ALIGN_CENTER);
        document.setFooter(footer);

        HeaderFooter header = new HeaderFooter(
                    new Phrase(title, new Font(bf)), false);
        header.setAlignment(Element.ALIGN_CENTER);
        document.setHeader(header);
    document.open();
  }
View Full Code Here


   * Salto de linea
   */
  public void saltoDeLinea(){
    try {
     
      document.add(new Phrase(ComunesConst.SALTO_LINEA));
    } catch (DocumentException e) {
      Tools.getStackTrace(e);
    }
  }
View Full Code Here

        // TODO Auto-generated catch block
        e.printStackTrace();
      }
        }
        // does it have phrase info?
        Phrase phrase = cell.getPhrase();
        if(phrase != null) {
            try {
        RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(phrase);
        for (int i = 0; i < rtfElements.length; i++) {
          rtfElements[i].setInTable(true);
View Full Code Here

  protected void drawComplexText(final RenderableComplexText node, final Graphics2D g2)
  {
    try
    {
      final Phrase p = createPhrase(node);
      final ColumnConfig cc = createColumnText(node);

      final PdfGraphics2D pg2 = (PdfGraphics2D) getGraphics();
      final PdfContentByte cb = pg2.getRawContentByte();
      ColumnText ct = cc.reconfigure(cb, p);
View Full Code Here

    return ct;
  }

  private Phrase createPhrase(final RenderableComplexText node)
  {
    Phrase p = new Phrase();
    RichTextSpec text = node.getRichText();
    for (RichTextSpec.StyledChunk c : text.getStyleChunks())
    {
      TypedMapWrapper<Attribute, Object> attributes = new TypedMapWrapper<Attribute, Object>(c.getAttributes());
      final Number size = attributes.get(TextAttribute.SIZE, 10f, Number.class);
      final PdfTextSpec pdfTextSpec = computeFont(c);
      final int style = computeStyle(attributes, pdfTextSpec);

      final Color paint = (Color) c.getStyleSheet().getStyleProperty(ElementStyleKeys.PAINT);
      // add chunks
      BaseFont baseFont = pdfTextSpec.getFontMetrics().getBaseFont();
      Font font = new Font(baseFont, size.floatValue(), style, paint);

      if (c.getOriginatingTextNode() instanceof RenderableReplacedContentBox)
      {
        RenderableReplacedContentBox content = (RenderableReplacedContentBox) c.getOriginatingTextNode();
        com.lowagie.text.Image image = imageHandler.createImage(content);
        if (image != null)
        {
          Chunk chunk = new Chunk(image, 0, 0);
        //  chunk.setFont(font);
          p.add(chunk);
        }
      }
      else
      {
        String textToPrint = c.getText();
        Chunk chunk = new Chunk(textToPrint, font);
        p.add(chunk);
      }
    }
    return p;
  }
View Full Code Here

                                                        packageData );

            document.newPage();

            // List index of the rules           
            document.add( new Phrase( "Table of Contents" ) );
            document.add( DroolsDocsComponentFactory.createContents( packageData.getRules() ) );

            document.newPage();

            for ( DrlRuleParser ruleData : packageData.getRules() ) {
View Full Code Here

        return index;
    }

    private static Cell newHeaderCell(String text,
                                      Font font) throws BadElementException {
        Cell c = new Cell( new Phrase( text,
                                       font ) );
        c.setBackgroundColor( Color.decode( "#CCCCFF" ) );
        c.setLeading( 10 );
        c.setBorder( 1 );
View Full Code Here

        return c;
    }

    private static Cell newCell(String text) throws BadElementException {
        Cell c = new Cell( new Phrase( text,
                                       BODY_TEXT ) );
        c.setLeading( 10 );
        c.setBorder( 0 );
        c.setBorderWidthBottom( 1 );
View Full Code Here

        return c;
    }

    public static HeaderFooter createFooter(String packageName) {
        HeaderFooter footer = new HeaderFooter( new Phrase( packageName + "-",
                                                            HEADER_FOOTER_TEXT ),
                                                true );
        footer.setBorder( 1 );
        footer.setAlignment( Element.ALIGN_RIGHT );
View Full Code Here

            cell1.setHorizontalAlignment( Element.ALIGN_LEFT );
            cell1.setBorder( 0 );

            head.addCell( cell1 );

            PdfPCell cell2 = new PdfPCell( new Phrase( currentDate,
                                                       DroolsDocsComponentFactory.HEADER_FOOTER_TEXT ) );
            cell2.setHorizontalAlignment( Element.ALIGN_RIGHT );
            cell2.setBorder( 0 );

            head.addCell( cell2 );
View Full Code Here

TOP

Related Classes of com.lowagie.text.Phrase

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.