You have to take the page rotation into account when adding the template.

Paulo

----- Original Message ----- 
From: "Ping Zhang" <[EMAIL PROTECTED]>
To: <itext-questions@lists.sourceforge.net>
Sent: Thursday, May 22, 2008 7:43 PM
Subject: [iText-questions] some pages are not displaying right


> Hi everyone,
>
> Please help! I have a application using iText to display/fill data on the
> exisiting multiple PDF forms (one form at a time) , all forms has two
> pages, with my code as the following, some application displaying form
> right, some application first page displaying right, but second page
> display in upside down view. Is anything to do with the cb.addTemplate?
>
>            Document doc = new Document(PageSize.LEGAL.rotate());
>            PdfReader reader = new PdfReader(getRealPath(pdfFile));
>                PdfWriter writer = PdfWriter.getInstance(doc,
> applicationStream);
>
>                        doc.open();
>
>                        PdfImportedPage page1 =
> writer.getImportedPage(reader, 1);
>                        PdfImportedPage page2 =
> writer.getImportedPage(reader, 2);
>
>                        PdfContentByte cb = writer.getDirectContent();
>
>                        cb.addTemplate(page1, 1, 0, 0, 1, 0, 0);
>                        cb.addTemplate(page2, 1, 0, 0, 1, 0, 0);
>
>                  BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA,
> BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
>
>                        cb.beginText();
>                        cb.setFontAndSize(bf, 10);
>                   ......
>                  cb.endText();
>
>                  doc.newPage();
>                        cb.beginText();
>                        cb.setFontAndSize(bf, 10);
>                  .....
>                  cb.endText();
>                  doc.close();
>
> Thanks.
> Ping W. Zhang
> North Pointe Insurance Group
> Phone (248) 358-1171 x3279
> Email [EMAIL PROTECTED] 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to