Title: RE: [iText-questions] newpage()


    -----Original Message-----
    From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] On Behalf Of Prasanna Gunjikar

    Sent:   Thursday, January 29, 2004 15:40
    To:     [EMAIL PROTECTED]
    Subject:        [iText-questions] newpage()


    Hi ..
    While i print my PDF i have predefined locations where i need to print the text on new page. But i have problems of an extra blank page when the text on previous page ends and the cursor automatically comes to a new page while in the code document.newpage() generates another new page rendering an extra blank page inbetween.

    This happens if your text has a '\n' at the end.

    To determine the newpage generation I tried "implements PdfPageEvent" (as i cannot extend helper due to another extends in the class)

    and then implemented
            public void onStartPage(PdfWriter writer, Document document)
            {
                    System.out.println("onStartPage " + document.getPageNumber());
            }

    But some how the method onStartPage( is not called ???

    what am i missing or is there any other way just by PDF writer to determine the new page already rendered.

    You need to call PdfWriter.setPageEvent().

    Best Regards,
    Paulo Soares

Reply via email to