Examples of RtfHeaderFooterGroup


Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

            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")),
                            com.lowagie.text.rtf.headerfooter.RtfHeaderFooter.DISPLAY_FIRST_PAGE);
            footer
                    .setHeaderFooter(
                            new RtfHeaderFooter(new LwgPhrase(
                                    "This is a left side page")),
                            com.lowagie.text.rtf.headerfooter.RtfHeaderFooter.DISPLAY_LEFT_PAGES);
            footer
                    .setHeaderFooter(
                            new RtfHeaderFooter(new LwgPhrase(
                                    "This is a right side page")),
                            com.lowagie.text.rtf.headerfooter.RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

        this.listTable = new RtfListTable(this.document);
        this.stylesheetList = new RtfStylesheetList(this.document);
        this.infoGroup = new RtfInfoGroup(this.document);
        this.protectionSetting = new RtfProtectionSetting(this.document);
        this.pageSetting = new RtfPageSetting(this.document);
        this.header = new RtfHeaderFooterGroup(this.document, RtfHeaderFooter.TYPE_HEADER);
        this.footer = new RtfHeaderFooterGroup(this.document, RtfHeaderFooter.TYPE_FOOTER);
        this.generator = new RtfGenerator(this.document);
    }
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

     * @param result
     */
    public void writeSectionDefinition(final OutputStream result)
    {
        try {
            RtfHeaderFooterGroup header = convertHeaderFooter(this.header, RtfHeaderFooter.TYPE_HEADER);
            RtfHeaderFooterGroup footer = convertHeaderFooter(this.footer, RtfHeaderFooter.TYPE_FOOTER);
            if(header.hasTitlePage() || footer.hasTitlePage()) {
                result.write(TITLE_PAGE);
                header.setHasTitlePage();
                footer.setHasTitlePage();
            }
            if(header.hasFacingPages() || footer.hasFacingPages()) {
                result.write(FACING_PAGES);
                header.setHasFacingPages();
                footer.setHasFacingPages();
            }
            footer.writeContent(result);
            header.writeContent(result);
            pageSetting.writeSectionDefinition(result);
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }     
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

     * @see com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup
     */
    private RtfHeaderFooterGroup convertHeaderFooter(HeaderFooter hf, int type) {
        if(hf != null) {
            if(hf instanceof RtfHeaderFooterGroup) {
                return new RtfHeaderFooterGroup(this.document, (RtfHeaderFooterGroup) hf, type);
            } else if(hf instanceof RtfHeaderFooter) {
                return new RtfHeaderFooterGroup(this.document, (RtfHeaderFooter) hf, type);
            } else {
                return new RtfHeaderFooterGroup(this.document, hf, type);
            }
        } else {
            return new RtfHeaderFooterGroup(this.document, type);
        }
    }
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

            date.setAlignment(LwgElement.ALIGN_CENTER);

            // Create the RtfHeaderFooterGroup for the header.
            // To display the same header on both pages, but not the
            // title page set them to left and right pages explicitly.
            RtfHeaderFooterGroup header = new RtfHeaderFooterGroup();
            header.setHeaderFooter(new RtfHeaderFooter(date), RtfHeaderFooter.DISPLAY_LEFT_PAGES);
            header.setHeaderFooter(new RtfHeaderFooter(date), RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
           
            // Set the header
            document.setHeader(header);

            // Create the paragraphs that will be used as footers
            Paragraph titleFooter = new Paragraph("Multiple headers / footers example");
            titleFooter.setAlignment(LwgElement.ALIGN_CENTER);
            Paragraph leftFooter = new Paragraph("Page ");
            leftFooter.add(new RtfPageNumber());
            Paragraph rightFooter = new Paragraph("Page ");
            rightFooter.add(new RtfPageNumber());
            rightFooter.setAlignment(LwgElement.ALIGN_RIGHT);
           
            // Create the RtfHeaderGroup for the footer and set the footers
            // at the desired positions
            RtfHeaderFooterGroup footer = new RtfHeaderFooterGroup();
            footer.setHeaderFooter(new RtfHeaderFooter(titleFooter), RtfHeaderFooter.DISPLAY_FIRST_PAGE);
            footer.setHeaderFooter(new RtfHeaderFooter(leftFooter), RtfHeaderFooter.DISPLAY_LEFT_PAGES);
            footer.setHeaderFooter(new RtfHeaderFooter(rightFooter), RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
           
            // Set the document footer
            document.setFooter(footer);
           
            document.open();
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

        this.listTable = new RtfListTable(this.document);
        this.stylesheetList = new RtfStylesheetList(this.document);
        this.infoGroup = new RtfInfoGroup(this.document);
        this.protectionSetting = new RtfProtectionSetting(this.document);
        this.pageSetting = new RtfPageSetting(this.document);
        this.header = new RtfHeaderFooterGroup(this.document, RtfHeaderFooter.TYPE_HEADER);
        this.footer = new RtfHeaderFooterGroup(this.document, RtfHeaderFooter.TYPE_FOOTER);
        this.generator = new RtfGenerator(this.document);
    }
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

     * @param result
     */
    public void writeSectionDefinition(final OutputStream result)
    {
        try {
            RtfHeaderFooterGroup header = convertHeaderFooter(this.header, RtfHeaderFooter.TYPE_HEADER);
            RtfHeaderFooterGroup footer = convertHeaderFooter(this.footer, RtfHeaderFooter.TYPE_FOOTER);
            if(header.hasTitlePage() || footer.hasTitlePage()) {
                result.write(TITLE_PAGE);
                header.setHasTitlePage();
                footer.setHasTitlePage();
            }
            if(header.hasFacingPages() || footer.hasFacingPages()) {
                result.write(FACING_PAGES);
                header.setHasFacingPages();
                footer.setHasFacingPages();
            }
            footer.writeContent(result);
            header.writeContent(result);
            pageSetting.writeSectionDefinition(result);
        } catch(IOException ioe) {
            ioe.printStackTrace();
        }     
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

     * @see com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup
     */
    private RtfHeaderFooterGroup convertHeaderFooter(HeaderFooter hf, int type) {
        if(hf != null) {
            if(hf instanceof RtfHeaderFooterGroup) {
                return new RtfHeaderFooterGroup(this.document, (RtfHeaderFooterGroup) hf, type);
            } else if(hf instanceof RtfHeaderFooter) {
                return new RtfHeaderFooterGroup(this.document, (RtfHeaderFooter) hf, type);
            } else {
                return new RtfHeaderFooterGroup(this.document, hf, type);
            }
        } else {
            return new RtfHeaderFooterGroup(this.document, type);
        }
    }
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

        this.fontList = new RtfFontList(this.document);
        this.listTable = new RtfListTable(this.document);
        this.stylesheetList = new RtfStylesheetList(this.document);
        this.infoGroup = new RtfInfoGroup(this.document);
        this.pageSetting = new RtfPageSetting(this.document);
        this.header = new RtfHeaderFooterGroup(this.document, RtfHeaderFooter.TYPE_HEADER);
        this.footer = new RtfHeaderFooterGroup(this.document, RtfHeaderFooter.TYPE_FOOTER);
    }
View Full Code Here

Examples of com.lowagie.text.rtf.headerfooter.RtfHeaderFooterGroup

     * @param result
     */
    public void writeSectionDefinition(final OutputStream result)
    {
        try {
            RtfHeaderFooterGroup header = convertHeaderFooter(this.header, RtfHeaderFooter.TYPE_HEADER);
            RtfHeaderFooterGroup footer = convertHeaderFooter(this.footer, RtfHeaderFooter.TYPE_FOOTER);
            if(header.hasTitlePage() || footer.hasTitlePage()) {
                result.write(TITLE_PAGE);
                header.setHasTitlePage();
                footer.setHasTitlePage();
            }
            if(header.hasFacingPages() || footer.hasFacingPages()) {
                result.write(FACING_PAGES);
                header.setHasFacingPages();
                footer.setHasFacingPages();
            }
            //.result.write(footer.write());
            footer.writeContent(result);
            //.result.write(header.write());
            header.writeContent(result);
            //.result.write(pageSetting.writeSectionDefinition());
            pageSetting.writeSectionDefinition(result);
        } catch(IOException ioe) {
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.