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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - GetPageText coming up empty on some documents
  FAQ FAQ  Forum Search   Register Register  Login Login

GetPageText coming up empty on some documents

 Post Reply Post Reply
Author
Message
swb1 View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert
Avatar

Joined: 05 Dec 05
Location: United States
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote swb1 Quote  Post ReplyReply Direct Link To This Post Topic: GetPageText coming up empty on some documents
    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.

 

Thanks, 

Steve

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store