Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
LoadFromFile failed (Delphi 2007) .. why? |
Post Reply |
Author | |
ZarkoGajic
Beginner Joined: 18 Mar 09 Location: Croatia Status: Offline Points: 19 |
Post Options
Thanks(0)
Posted: 18 Mar 09 at 8:56AM |
Hi,
I have a PDF file that refuses to be loaded using TQuickPDF0712 (Delphi 2007) LoadFromFile method.
The result of the function is "0 - The file could not be read or processed".
The PDF is not password protected. It loads in Adobe Reader and FoxIt.
p.s.
Other documents load with no problems.
How to determine the cause of this problem? Can I upload this PDF somewhere for a test?
-zarko gajic
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Zarko!
You can send it to me at ingo -dot- schmoekel -at- ewetel -dot- net BTW: Are you the Zarko from delphi.about.com? Welcome here! Cheers, Ingo |
|
ZarkoGajic
Beginner Joined: 18 Mar 09 Location: Croatia Status: Offline Points: 19 |
Post Options
Thanks(0)
|
Ingo,
Thanks for the offer.
I "know" that the file is corrupted .. I just am not sure why it loads with Acrobat Reader with no problems .. plus it would be great if when LoadFromFile fails .. a more descriptive error is provided.
p.s.
PDF sent to your email..
p.s.
Yes, Zarko Gajic from delphi.about.com :)
|
|
DELBEKE
Debenu Quick PDF Library Expert Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
Post Options
Thanks(0)
|
Hi Zarko
The most frenquetly corrupted pdf are corrupted in the cross reférence (generaly at the end of the file). When Acrobat reader find this kind of corruption, he corrects the problem with a complete reconstruction of cross reference.
I suppose QuickPdf library will do it in a near future.
Cheers
Edited by DELBEKE - 18 Mar 09 at 11:06AM |
|
ZarkoGajic
Beginner Joined: 18 Mar 09 Location: Croatia Status: Offline Points: 19 |
Post Options
Thanks(0)
|
Hi,
How about some kind of descriptive (error) message to why the LoadFromFile has failed?
-zarko
|
|
DELBEKE
Debenu Quick PDF Library Expert Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
Post Options
Thanks(0)
|
Of course, these would be kind ;)
But not easy to implement I think. A easyer way should be a return value more significant, actualy 0, all is correct and 1, load has fail. Edited by DELBEKE - 18 Mar 09 at 12:11PM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Zarko!
I've looked inside with PSPad (you can use any other editor as well). The first content you can see below. I've deleted the string "%%EOF", made a new save and then QuickPDF had no problem to read/load the file! It's a distiller document initially created with Word. Where this E(nd)O(f)F(ile) comes from... i don't know? A real accident ;-) A 100 mb adobe reader installation can handle this - for the 2 mb of QuickPDF it's not so easy i fear. Cheers, Ingo %PDF-1.5 %âãÏÓ 10 0 obj <</Linearized 1/L 6181/O 12/E 1733/N 1/T 5934/H [ 456 163]>> endobj xref 10 8 0000000016 00000 n 0000000619 00000 n 0000000731 00000 n 0000000927 00000 n 0000001075 00000 n 0000001413 00000 n 0000001656 00000 n 0000000456 00000 n trailer <</Size 18/Prev 5923/Root 11 0 R/Info 9 0 R/ID[<CA83DDF33197EBFD70368E5A30920D4E><900CDB0B84391E449A21F582F7E253EB>]>> startxref 0 %%EOF 17 0 obj <</Length 73/Filter/FlateDecode/I 101/L 85/O 69/S 38>>stream xÚb```e``²` Edited by Ingo - 18 Mar 09 at 3:05PM |
|
ZarkoGajic
Beginner Joined: 18 Mar 09 Location: Croatia Status: Offline Points: 19 |
Post Options
Thanks(0)
|
Ingo,
Thanks for the info.
I do not have any idea what this EOF is doing there :(
p.s.
Need to process a bunch of PDFs in my application and this file failed to load.
What is important here is that this file IS corrupted - the fact that AdobeReader can read it .. who cares .. for me it would be enough to report as "cannot open file".
|
|
DELBEKE
Debenu Quick PDF Library Expert Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
Post Options
Thanks(0)
|
Hi zarko
In fact it does indicate you that the file can' be laoded.
Here is a sample writen in vb6
On Error Resume Next
lRet = m_oDoc.LoadFromFile(Value) On Error GoTo 0 If lRet = 0 Then MsgBox "File can not be opened", vbCritical Exit Sub End If |
|
ZarkoGajic
Beginner Joined: 18 Mar 09 Location: Croatia Status: Offline Points: 19 |
Post Options
Thanks(0)
|
Delbeke,
I am aware of the function result value ... my question was initially related to "why" does it fail to load - since AReader can open it.
The answer was provided by Ingo.
|
|
deabrew
Newbie Joined: 19 Jan 09 Status: Offline Points: 43 |
Post Options
Thanks(0)
|
Zarko, Delbeke, and Ingo (plus readers),
We're working on providing a solution for this problem to include in an upcoming version (7.13) of Quick PDF Library. Today, the production version of 7.12 will be released. And thanks all. Cheers, -Karl -Karl |
|
DELBEKE
Debenu Quick PDF Library Expert Joined: 31 Oct 05 Location: France Status: Offline Points: 151 |
Post Options
Thanks(0)
|
The problem don't come with this %%EOF. This is a linearized pdf. A pdf can contain more than one %%EOF in 2 cases : linearisation and incremental save. The real problem come with startxref 0. That QuickPdf can not handle at the momment.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store