Examples of HeaderFooter


Examples of com.aspose.words.HeaderFooter

        }
    }

    private static void insertWatermarkIntoHeader(Paragraph watermarkPara, Section sect, int headerType) throws Exception
    {
        HeaderFooter header = sect.getHeadersFooters().getByHeaderFooterType(headerType);

        if (header == null)
        {
            // There is no header of the specified type in the current section, create it.
            header = new HeaderFooter(sect.getDocument(), headerType);
            sect.getHeadersFooters().add(header);
        }

        // Insert a clone of the watermark into the header.
        header.appendChild(watermarkPara.deepClone(true));
    }
View Full Code Here

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

Examples of com.lowagie.text.HeaderFooter

        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

Examples of com.lowagie.text.HeaderFooter

    } 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

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

Examples of com.lowagie.text.HeaderFooter

        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

Examples of com.lowagie.text.HeaderFooter

            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

Examples of com.lowagie.text.HeaderFooter

            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

Examples of com.lowagie.text.HeaderFooter

     * @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

Examples of com.lowagie.text.HeaderFooter

            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
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.