Inserting PNG ImageSource into a document and applying the document instance directly to the RadPdfViewer`s Document property (without exporting to stream) leads to a wrong image rendering.
Workaround: Export the document with the PdfFormatProvider:
MemoryStream ms = new MemoryStream();
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.Export(radFixedDocument, ms);
PdfDocumentSource source = new PdfDocumentSource(ms, pdfViewer.DefaultImportSettings);
this.pdfViewer.DocumentSource = source;
This is not a valid PDF scenario as having appearance state requires having multistate appearances. However, we should handle this invalid document scenario on our side so that the app does not crash with NullReferenceException.
When there is no ToUnicode CMap, the text from the Simple Font instance should be extracted by mapping the glyph name to its corresponding charcode according to Adobe Glyph List. Additionally, the Differences array should be included in these calculations when there is custom encoding. The current implementation of RadPdfViewer makes ToString to the original char id byte value which leads to wrong characters.
Creating a PdfViewer instance without adding it in the visual tree, leads to leaked document presenter instances when the TouchManager is enabled.
Workaround: Disable the TouchManager:
Telerik.Windows.Input.Touch.TouchManager.IsEnabled = false;
Currently, the PdfProcessing document model is providing support only for a single function in the Function entry.
According to the PDF Specification: Function: A 1-in, n-out function or an array of n 1-in, 1-out functions.
BT 48 819.32 Td -16.6 Ts (Some text to display) Tj ET
Currently, when we parse inline image dictionaries we rely on the assumption that the colorspace will be PdfName. However, there are files with complex colorspaces that are PdfArray and InvalidCastException is thrown. All the content after this exception is lost and not visualized by RadPdfViewer.
Add support for Lab color space. Currently alternate color is used to render the pixels, which may result in incorrect colors.
According to the PDF specification (Adobe® Portable Document Format Version 1.7):
Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions width and height in user space.
The operation:
x y width height re
An invalid case:
0 - 595 -842 re
This leads to an exception thrown: System.NullReferenceException: 'Object reference not set to an instance of an object.'
Hi Telerik Support
We use your Telerik PDF-Viewer since your last Version "UI for WPF R1 2021" which supports Type 3 fonts.
Now the version runs productive by our customers. But after a day, they found some special PDFs that doesn't work quite right with your PDF-Viewer.
In the appendix you will find the PDf-Files as samples for the bugs that i'm describing.
Because of data privacy, the PDF-Files are cutted and cropped.
Also a demo project is appended (It could also be reproduced with the demo Progress Telerik WPF UI for th PDF-Viewer).
First Problem: Blank Page
Hint: It seems that only a few PDF-Files from a specific program seems to be a problem.
Second Problem: Displaying data delayed
I would be glad for a quick possible solution for our customer.
Best regards
Serge Schoop