Adobe reader XI 11.0.13 "an error exists on this page"

It looks like some combination of what I am doing in the following code is resulting in a corrupt PDF being generated.


I need to use TextStamp for a watermark, HtmlFragments, and ProcessParagraphs. In this example, the PDF is generated but when you scroll to a certain page, you get this error from Adobe Reader 11.0.13

"An Error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem."

We are considering purchasing this software soon, but we’re in the process of proving that it will do what we need first. If we can get this resolved I believe that is the final roadblock.

Here is the code:

Document PdfDocument = new Document();
Page myPage = PdfDocument.Pages.Add();

string fullNameFormatted = “Malcolm Millhouse Reynolds”;
TextFragment myHeading = new TextFragment(fullNameFormatted) {
TextState = {
FontSize = 40
},
Margin = new MarginInfo {
Bottom = 20,
Top = 150
}
};
myPage.Paragraphs.Add(myHeading);

string html = “some html with no tags”;
HtmlFragment obit = new HtmlFragment(html);
myPage.Paragraphs.Add(obit);


// make sure the total page count is a multiple of 4 by adding blank pages towards the end
PdfDocument.ProcessParagraphs();
int totalPages = PdfDocument.Pages.Count;
int pagesToAdd = totalPages % 4;
for (int i = 0; i < pagesToAdd; i++) {
PdfDocument.Pages.Insert(totalPages);
}

TextStamp previewStamp = new TextStamp(“Preview”);

foreach (Page page in PdfDocument.Pages) {
page.AddStamp(previewStamp);
}

string fileName = “D:\Users\bob\Desktop\scratch\pdftest\test.pdf”;
PdfDocument.Save(fileName);


Thanks,
Brian


Hi Brian,


Thanks for your interest in Aspose.

I have tested the scenario using your sample code and unable to notice with Adobe Acrobat XI and Adobe Reader 11.0.10. Please find attached sample output, test and share the results. We will investigate it further.

We are sorry for the inconvenience caused.

Best Regards,
Thanks for the initial response.

I tried your test.pdf and had no issues, so I'm attaching mine as testError.pdf for your reference.

It appears the error is on the second page as it doesn't show up until you reach it when scrolling.

Also, in previous testing, I've found that doing any one of the following three things removes the error.

1) Remove the TextStamp code
2) Remove call to ProcessParagraphs
3) Change HtmlFragment to TextFragment

Lastly, we are using .NET framework 4.5.2 and
Aspose.Pdf Runtime Version v4.0.30319
Aspose Pdf Version 11.0.0.0
"Aspose.Pdf.11.0.0\lib\net40-client\Aspose.Pdf.dll"

Please let me know if there is anything else that I can add to assist you in reproducing and tracking down this issue.


As I was comparing the two PDF’s I noticed that the good one was produced with


Aspose.Pdf for .NET 11.1.0

The one with the error was produced with

Aspose.Pdf for .NET 11.0.0

If you could provide me with version 11.1.0 and also test on your side with the 11.0.0, that would help us rule out the version as the issue.

Thanks,
Brian

I’ve ran this through acrobat’s preflight syntax analysis and found this error on the error pdf (you test pdf was fine).


Unfortunately, I’m not sure what exactly is causing that error, but I hope it is more useful to you.

Preflight Summary Report for: testError.pdf
Profile: Report PDF syntax issues (Processed pages 1 to 2)
Processed by bcoons, Date: 12/28/2015 12:16 PM
Results (Summary)
Error
Missing XObject “Fm0” (5 matches on 1 page) - 2

Results (Summary)
Error
Missing XObject “Fm0” (5 matches on 1 page) - 2
Document information
File name: "testError.pdf"
Path: "D:\Users\bcoons\Desktop\scratch\pdftest"
PDF version number: "1.7"
File size (KB): 77.7
Creator: "Aspose Ltd."
Producer: "Aspose.Pdf for .NET 11.0.0"
Created: "12/23/2015 1:21 PM"
Modified: "12/23/2015 1:21 PM"
Trapping: "Unknown"
Number of plates: 4
Names of plates: "(Cyan) (Magenta) (Yellow) (Black) "
Environment
Preflight, 15.0.0 (151)
Acrobat version: 15.90
Operating system: Microsoft Windows 7 Service Pack 1 (Build 7601)

Hi Brian,

Thanks for sharing additional information. I have noticed that you are evaluating without a valid license so getting the subjected issue. Please note Aspose.Pdf evaluation version has two limitations, evaluation watermark and at most four elements of any collection can be viewed. Please make a request for 30 days temporary license to evaluate our product without any limitation. It will resolve the issue.

Please feel free to contact us for any further assistance.

Best Regards,

I do have a temporary license and get this issue even when the evaluation watermark is gone.


I did not include the license code in my example in order to keep the code short.

Please continue to investigate this issue. You can see clearly from the information I posted that Aspose.Pdf is generating a PDF with a missing Xobject.

Hi Brian,


Thanks for sharing the details. We are further looking into this matter based on details which you have shared and will get back to you soon.

Hi Brian,


We are sorry for the delayed response. Yes I have tested the scenario in Aspose.Pdf for .NET 11.0.0 and noticed the reported issue. However the issue is fixed in latest release 11.1.0, so please download and use latest version of Aspose.Pdf for .NET. It will help you to accomplish the task.

Furthermore, I have noticed that in evaluation version API is adding incorrect evaluation watermark text in 2nd page of the PDF document, so logged a ticket PDFNEWNET-40078 for further investigation and rectification.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan