This is a migrated thread and some comments may be shown as answers.

Telerik PDF viewer with silverlight

5 Answers 147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Elena
Top achievements
Rank 1
Elena asked on 26 Feb 2013, 06:05 AM
Hi,
We have a telerik pdf viewer in XAML file and load pdf file from stream
PDFview.pdfViewer.DocumentSource = New
PdfDocumentSource(New MemoryStream(_docData.Data))
but some pdf files e.g.TelerikReporting-LearningGuide.pdf are displayed incorrect (wrong encoding, strange signs or not displayed att all without error message)
Would be very grateful for any hints.

Best regards
Elena

5 Answers, 1 is accepted

Sort by
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 28 Feb 2013, 09:44 AM
When you save the files to disk and open with adobe reader does it display ok?
What font are you using?
Does it work ok with Arial or Times New Roman?
Do you have font embedding on the PDF?
0
Elena
Top achievements
Rank 1
answered on 28 Feb 2013, 09:58 AM
Hi,

When I open Byte array as Uri in Internet Explorer it display Ok.
I save ANY pdf file in my Database as Byte array and then try to open it in my Silverlight application on Client side.
Don't use encoding when save the file.

Best regards
Elena
0
Petya
Telerik team
answered on 04 Mar 2013, 01:40 PM
Hi Elena,

It seems that the problem may be caused by null bytes at the end of the PDF document.

In some cases when the document is preserved in a database, it has many null bytes appended at the end. RadPdfViewer starts to read the PDF files from their end trying to locate the %%EOF marker. If there are such null bytes, the marker cannot be found and the file cannot be loaded properly.
I hope this helps!

Regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Elena
Top achievements
Rank 1
answered on 05 Mar 2013, 10:08 AM
Hi Petya,
Thank you for reply.
I checked byte arrays for pdf files which are not displayed correct.
One file which shows wrong characters (see attached)  has 11997243 bytes and  "79,70,13" in the end.
Second file which has 12792773 bites and "79,70,13,10" in the end
and doesn't return any Document at all:

?New PdfDocumentSource(New MemoryStream(_docData.Data))

{Telerik.Windows.Documents.Fixed.PdfDocumentSource}

Document: Nothing

 
0
Kammen
Telerik team
answered on 07 Mar 2013, 12:57 PM
Hello Elena,

I think there might be a misunderstanding here. Can you please comment on the following:
1. Which version of RadPdfViewer you are using?
2. When you save this file as .pdf file, can you open it with RadPdfViewer (both in your application and in our online demo)?
3. When you are trying to load the pdf document in RadPdfViewer from your database, what is displayed? (A screenshot may be helpful here.)

We have tested this document (TelerikReporting-LearningGuide.pdf) in our online demo and it seems that everything is working as expected. The online demo is using Q1 version of our controls, which brings an entirely new text rendering system for RadPdfViewer.

Hope this will help you find where the problem is.

Regards,
Kammen
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Elena
Top achievements
Rank 1
Answers by
Hadib Ahmabi
Top achievements
Rank 1
Elena
Top achievements
Rank 1
Petya
Telerik team
Kammen
Telerik team
Share this question
or