Can't open this SIMPLE pdf file

6 posts, 1 answers
  1. Sandhiya
    Sandhiya avatar
    13 posts
    Member since:
    Jul 2013

    Posted 27 Aug 2013 Link to this post

    Even on telerik demo page.
    You can download the pdf file on here.
    Any one can give me a clue on this?

    thanks
  2. Sandhiya
    Sandhiya avatar
    13 posts
    Member since:
    Jul 2013

    Posted 28 Aug 2013 Link to this post

    Now the problem become more complex.
    Some pdf files can be opened, and some files can't.
    All pdf files are generated by iTextSharp 5.4.3

    Below are 2 sample files:
    Can be opened.
    Can't be opened.

    Any comment will be appreciated.
  3. DevCraft banner
  4. Alexander
    Admin
    Alexander avatar
    41 posts

    Posted 29 Aug 2013 Link to this post

    Hello Sandhiya,

    Thank you for contacting us!
    The first document (DO13080002.pdf) is loaded correctly, but the second one (DO13080003.pdf) is not.
    We will need to investigate this issue further.

    If you have any other questions or concerns, please do not hesitate to contact us again!

    Regards,
    Alexander
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Sandhiya
    Sandhiya avatar
    13 posts
    Member since:
    Jul 2013

    Posted 29 Aug 2013 Link to this post

    Hi Alexander,

    I have opened support ticket (#731428).
    In there, I already submit 2 similar pdf files.
    1 file has table with borders (loaded correctly), the other 1 file has table without borders (failed to be loaded).
    All the contents between that 2 files are 100% same.
    So I think the issue is with table borders.

  6. Answer
    Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 30 Aug 2013 Link to this post

    Hi,

    Actually, the problem with the files you provided is that they do not end with %%EOF marker. This marker is required for RadPdfViewer to work correctly. If you open your files with any text editor (Notepad for example), you will find that your document ends with a lot of null bytes. RadPdfViewer is designed to search for %%EOF marker in the last 1024 bytes. If it does not find one, the document will not be displayed at all. You will need to trim those null bytes in order to open the documents in RadPdfViewer.

    More information about this can be found in this help article.

    Let us know if you have further questions.

    Regards,
    Kammen
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  7. Sandhiya
    Sandhiya avatar
    13 posts
    Member since:
    Jul 2013

    Posted 30 Aug 2013 Link to this post

    Hi Kammen, thank you for pointing this out.
    You are right, we use wrong method when converting from MemoryStream to byte[]
    We use .GetBuffer() instead of .ToArray()
    And we also don't realize there are so many trailing nulls in the pdf file.


Back to Top
DevCraft banner