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

Can't open this SIMPLE pdf file

5 Answers 138 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Sandhiya
Top achievements
Rank 1
Sandhiya asked on 27 Aug 2013, 06:31 PM
Even on telerik demo page.
You can download the pdf file on here.
Any one can give me a clue on this?

thanks

5 Answers, 1 is accepted

Sort by
0
Sandhiya
Top achievements
Rank 1
answered on 28 Aug 2013, 04:40 PM
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.
0
Alexander
Telerik team
answered on 29 Aug 2013, 08:33 AM
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 >>
0
Sandhiya
Top achievements
Rank 1
answered on 29 Aug 2013, 08:56 AM
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.

0
Accepted
Kammen
Telerik team
answered on 30 Aug 2013, 08:37 AM
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 >>
0
Sandhiya
Top achievements
Rank 1
answered on 30 Aug 2013, 09:50 AM
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.


Tags
PDFViewer
Asked by
Sandhiya
Top achievements
Rank 1
Answers by
Sandhiya
Top achievements
Rank 1
Alexander
Telerik team
Kammen
Telerik team
Share this question
or