wPDF Created a PDF where last two pages display as blank pages

  • I am using wPDF V3 with Delphi 5. I have a five page RTF that I want to convert to a PDF using the following code.

    WPPDFRichText1 := TWPRichText.Create( Self );

    WPPDFExport1.FileName := ExtractFilePath( Application.EXEName ) + 'pdf_from_rtf.PDF';

    WPPDFRichText1.LoadFromFile( ScrFn );

    WPPDFExport1.Source := WPPDFRichText1;

    WPPDFExport1.Execute;

    When I view the resulting PDF the first three pages are fine, but the last two pages are blank. When I view the PDF using a simpe text editor I can see the data for the last two pages. Do you have any ideas on why the last two pages are not being rendered properly when the document is viewed through a PDF viewer?