Telerik PDF viewer with silverlight

6 posts, 0 answers
  1. Elena
    Elena avatar
    8 posts
    Member since:
    Jun 2011

    Posted 26 Feb 2013 Link to this post

    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
  2. Hadib Ahmabi
    Hadib Ahmabi avatar
    181 posts
    Member since:
    Nov 2011

    Posted 28 Feb 2013 Link to this post

    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?
  3. DevCraft banner
  4. Elena
    Elena avatar
    8 posts
    Member since:
    Jun 2011

    Posted 28 Feb 2013 Link to this post

    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
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 04 Mar 2013 Link to this post

    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.

  6. Elena
    Elena avatar
    8 posts
    Member since:
    Jun 2011

    Posted 05 Mar 2013 Link to this post

    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

     
  7. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 07 Mar 2013 Link to this post

    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.

Back to Top
DevCraft banner