Package com.lowagie.text

Examples of com.lowagie.text.HeaderFooter


        try {
            PdfWriter.getInstance( document,
                                   out );

            HeaderFooter footer = DroolsDocsComponentFactory.createFooter( packageData.getName() );

            document.setFooter( footer );

            document.addTitle( packageData.getName().toUpperCase() );
            document.open();
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 );

        return footer;
    }
View Full Code Here

    } catch (Exception e) {
      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

        try {
            PdfWriter.getInstance( document,
                                   out );

            HeaderFooter footer = DroolsDocsComponentFactory.createFooter( packageData.getName() );

            document.setFooter( footer );

            document.addTitle( packageData.getName().toUpperCase() );
            document.open();
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 );

        return footer;
    }
View Full Code Here

            Table headerTable = new Table(3);
            headerTable.addCell("Test Cell 1");
            headerTable.addCell("Test Cell 2");
            headerTable.addCell("Test Cell 3");
            HeaderFooter header = new RtfHeaderFooter(headerTable);
            RtfHeaderFooterGroup footer = new RtfHeaderFooterGroup();
            footer
                    .setHeaderFooter(
                            new RtfHeaderFooter(new LwgPhrase(
                                    "This is the footer on the title page")),
View Full Code Here

            document.setHeader(new RtfHeaderFooter(header));
           
            // If the footer (or header) is to be the same for all Chapters
            // then it has to be set before the document is opened and is
            // then automatically set for all Chapters.
            document.setFooter(new HeaderFooter(new LwgPhrase("This is page "), new LwgPhrase(".")));
           
            document.open();
           
            Chapter chapter1 = new Chapter("Chapter 1", 1);
            chapter1.add(new Paragraph("This document has different headers and footers " +
View Full Code Here

     * @param doc
     *  document object
     */
    public void addHeaderFooter(Document doc) {
            // Set the author name and project description as the file header
            HeaderFooter footer = new HeaderFooter(new Phrase(projectDesc + " - " + author, FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL, new Color(64, 62, 62))), false);

            // Set page number as the file footer
            HeaderFooter header = new HeaderFooter(new Phrase("Page ", FontFactory.getFont(FontFactory.TIMES_ROMAN, 10, Font.NORMAL, new Color(64, 62, 62))), true);
            footer.disableBorderSide(Rectangle.TOP);
            footer.disableBorderSide(Rectangle.BOTTOM);

            // Set the footer alignment to the center
            footer.setAlignment(Rectangle.ALIGN_CENTER);
            header.disableBorderSide(Rectangle.TOP);
            header.disableBorderSide(Rectangle.BOTTOM);

            // Set the footer alignment to the right
            header.setAlignment(Rectangle.ALIGN_RIGHT);
            doc.setHeader(header);
            doc.setFooter(footer);
    }
View Full Code Here

            initTable();

            // Initialize the Document and register it with PdfWriter listener and the OutputStream
            Document document = new Document(PageSize.A4.rotate(), 60, 60, 40, 40);
            document.addCreationDate();
            HeaderFooter footer = new HeaderFooter(new Phrase(TagConstants.EMPTY_STRING, smallFont), true);
            footer.setBorder(Rectangle.NO_BORDER);
            footer.setAlignment(Element.ALIGN_CENTER);

            PdfWriter.getInstance(document, out);

            // Fill the virtual PDF table with the necessary data
            generatePDFTable();
View Full Code Here

    //TODO aSubject.append(itsVersion);
    // aSubject.append(" - ");
    aSubject.append(getDateTime());
    theDocument.addSubject(aSubject.toString());
    //TODO in footer?
    HeaderFooter aHeader = new HeaderFooter(
        new Phrase(aSubject.toString()), false);
    //    aHeader.setBorder(Rectangle.NO_BORDER);
    // aDocument.setHeader(aHeader);
    HeaderFooter aFooter = new HeaderFooter(new Phrase(), true);
    aFooter.setAlignment(HeaderFooter.ALIGN_RIGHT);
    aFooter.setBorder(Rectangle.NO_BORDER);
    theDocument.setFooter(aFooter);

    theDocument.open();

    theDocument.add(new Phrase(itsTitle, FontFactory.getFont(
View Full Code Here

TOP

Related Classes of com.lowagie.text.HeaderFooter

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.