CreatePage returns NULL after PDFDocument.Append

A shortened version of code (in C#) is:

IPDFPage newPage;
..............
pdfDoc = PDFDocument.Append(pdfDoc, rptStream);
pdfDoc.ReleaseStream();
.............
newPage = pdfDoc.CreatePage();

The pdfDoc.CreatePage returns a NULL that causes an error. The CreatePage works if I don't precede it with an APPEND. (The rptStream comes from Crystal Reports.)

Any ideas on what I am doing wrong?

3 Replies

DK Dhivya K Syncfusion Team January 25, 2007 01:04 PM UTC

Hi Dick,

Thank you for your interest in Essential PDF.

Thanks for the code snippet. I was able to reproduce the issue. Could you please use the following statement for adding a new page to the appended document?

C#
// Adds a new page to the appended document.
pdfdoc.Pages.Add(pdfdoc.CreatePage());

Here is a sample for your reference:
inserting_page.zip

Please take a look into it and let me know if you it meets your need.

Regards,
Dhivya.


DB Dick Barney January 26, 2007 01:19 PM UTC

THanks for the reply. I had switched to using memory streams without problems shortly after posting. I still have the old code and should find time to test it next week.

Again.......Thank You for the prompt reponse.


DK Dhivya K Syncfusion Team January 28, 2007 02:39 PM UTC

Hi Dick,

Thank you for the update. Please let me know if you have any queries.

Regards,
Dhivya.

Loader.
Up arrow icon