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!
GetPageText coming up empty on some documents |
Post Reply |
Author | |
swb1
Debenu Quick PDF Library Expert Joined: 05 Dec 05 Location: United States Status: Offline Points: 100 |
Post Options
Thanks(0)
Posted: 24 Nov 07 at 1:24PM |
I have some documents that fail to yield anything to GetPageText(3) yet the text renders properly. I think I have found the code that causes the problem, though, I am not certain that my solution is appropriate. If version 5.20 of module uPDFRenderer at line 1350 I found this code segment: for X := 1 to Length(Text) div 2 do begin UC := Ord(Text[X * 2 - 1]) * 256 + Ord(Text[X * 2]); UX := 0; UFound := False; while (not UFound) and (UX < Length(FFontCol.FoundFontData.DisplayCS2)) do begin if (UC >= FFontCol.FoundFontData.DisplayCS2[X].StartCode) and (UC <= FFontCol.FoundFontData.DisplayCS2[X].EndCode) then begin UC := FFontCol.FoundFontData.DisplayCS2[X].ResultCode + UC - FFontCol.FoundFontData.DisplayCS2[X].StartCode; UFound := True; end else Inc(UX); end; if UFound then MapText := MapText + WideChar(UC); end; I believe that this is the correction that is necessary. if (UC >= FFontCol.FoundFontData.DisplayCS2[UX].StartCode) and (UC <= FFontCol.FoundFontData.DisplayCS2[UX].EndCode) then begin UC := FFontCol.FoundFontData.DisplayCS2[UX].ResultCode + UC - FFontCol.FoundFontData.DisplayCS2[UX].StartCode; This seems to solve the problem that I have been having with these documents. The documents appear to have WideStrings and when the WideStrings are not decoded properly they come back as null strings. Marian, can you confirm my change? Because I am unfamiliar with Font handling and WideString handling, I cannot be confident that what I am doing here is correct. Steve |
|
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