Edit this page

Troubleshooting Common Problems

This article describes common problems that can be encountered when using RadPdfViewer and their solutions.

PDF retrieved from database is not shown correctly

There are several perquisites that have to be fulfilled in order for a PDF file to be loaded correctly. Some of them are listed here, along with the ways to show a file.

When retrieving a file as a byte array from database and creating a MemoryStream from it, there are cases when the retrieved file is not shown correctly. This is usually due to additional NULL(0) bytes appended to the end of the document when it was stored in the database.

PDF files have to end with %%EOF marker, so this essentially makes the document invalid and RadPdfViewer is unable to show it. RadPdfViewer is looking for this marker in the last 1024 bytes and if it does not find it, throws an exception.

In order to fix the issue, you can manually trim the additional (null) bytes.

Document are not printed correctly - different sized text, tapered lines and contents out of position

Silverlight 5's vector printing is not always executed correctly on postscript printers. This results in tapered document, only lines being shown or other visible changes in the printed document.

The problem is usually fixed with either of the following solutions:

  • Installing the latest postscript drivers on the printer.

  • Disabling vector printing and forcing the document to be printed using bitmap printing.

The latter can be done by setting the ForceVector property of PrintSettings:

    pdfViewer.Print(new PrintSettings() { ForceVector = false});
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article