Ok, trying again....

Firstly, I'm using DroidText (http://code.google.com/p/droidtext/) the
Android port of iText 2.17.

I have mixed pagesize documents in my App. starting off with a rotated
(landscape) page and occasionally switching to portrait for one page before
switching back again. Every page has a header and a footer. The footer
appears in the right place on every page but the header appears in the
"middle" of the page on the portrait pages, approximately the height above
the footer that they would be appearing on the landscape page

    Document document = new Document();
    document.setPageSize(PageSize.A4.rotate());

            HeaderFooter footer = new HeaderFooter(new
Phrase(10,footerText),false);
            footer.setAlignment(Element.ALIGN_CENTER);
            document.setFooter(footer);

            for(int page:pages){

     HeaderFooter header = new HeaderFooter(new
Phrase(10,headerText),false);
header.setAlignment(Element.ALIGN_CENTER);
      document.setHeader(header);

     if(page!=firstpage){

document.setPageSize(PageSize.A4.rotate());
                        }

     if(document.isOpen())
                                    document.newPage();
     else
                                    document.open();

                        // output pages of stuff

                        // add one portrait page at the end
                        document.setPageSize(PageSize.A4);
                        document.resetHeader();
                        header = new HeaderFooter(new
Phrase(10,headerText),false);
                        header.setAlignment(Element.ALIGN_CENTER);
                        document.setHeader(header);
                        document.newPage();

                        // output one page of stuff including a table

            }
            document.close()

I've tried different combinations of setting the heading before and after
the newpage and the use of resetheader but no change. What is the correct
way of doing it?

Thanks,

Craig
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to