Reputation: 11
So I'm using PdfContentByte to draw a simple line in an itextsharp pdf document, but when using it i get an error that says "An error exists on this page. Acrobat may not display the page correctly". Does anyone have a solution to this? The error usually pops up after I have selected to print the document.
Here is my code:
`cb.BeginText();
cb.SetLineWidth(1.0f);
cb.MoveTo(37.0f, doc.PageSize.Height - 105.0f);
cb.LineTo(doc.PageSize.Width - 37.0f, doc.PageSize.Height - 105.0f);
cb.Stroke();
cb.EndText();`
thanks in advance
Upvotes: 1
Views: 1991
Reputation: 15870
You may not have anything but text operators between a BeginText()
and EndText()
pair. Move your line art code outside them.
Upvotes: 1
Reputation: 2354
There is a fix on this site:
http://sajeevkumar.com/blog/?p=155
It is more specific to java but I believe the api's are very similar. My other thoughts are to do with there being a page object, sometimes pdf frameworks produce mangled output unless you explicitly create a page object within said pdf and then draw onto the page...
Upvotes: 0