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 - Range Check Error
  FAQ FAQ  Forum Search   Register Register  Login Login

Range Check Error

 Post Reply Post Reply
Author
Message
Dmitry View Drop Down
Team Player
Team Player


Joined: 21 Sep 06
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmitry Quote  Post ReplyReply Direct Link To This Post Topic: Range Check Error
    Posted: 28 Oct 06 at 1:42AM
Hi!
Please tell me about this error. It that cases it occurs?


Qp.LoadFromFile('sample.pdf');
for i := 1 to Qp.PageCount do
begin
   Qp.SelectPage(i);
   PageList_.Add(Qp.GetPageText(3));
end;


At the page with number 14 occurs this error.
Page with number 14 consists of many images, but also has a little of text.


Back to Top
Dmitry View Drop Down
Team Player
Team Player


Joined: 21 Sep 06
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmitry Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 06 at 8:58AM
Really noone knows why occurs this error?

Here is this page:
www.self-disciple.gorodok.net/sample.pdf

Please try to extract text from this sample.


Edited by Dmitry
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 06 at 10:32AM
Hi!

I've got the same error while rendering to file ...
I've seen the file is created with ActivePDF ... There're often Problems with ActivePDF ...
I'm out of office now but i know i've a solution for you ;-)    Be patient 'till tomorrow ...

Best regards,
Ingo


Edited by Ingo
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 06 at 3:52PM
Hi Dimitry!

If you're source-license owner i can help you immediately. If not you can wait 'till 5.15 will be released here or you should tell me which dcu-version you need ... ;-)

With my code and the modificated version 5.15 i can extract the text from your sample...

Best regards,
Ingo

// First i open the pdf making a copy to work with.
// Sometimes i've problems with missing embedded fonts...
// so i add one by myself...

   QP := TiSEDQuickPDF.Create;
   try
       QP.UnlockKey('MyKey');
       QP.LoadFromFile(Edit1.Text);
       If QP.Encrypted > 0 Then
          QP.Unencrypt;
       QP.AddStandardFont(0);   
       QP.SaveToFile(tpath + '_' + ExtractFileName(Edit1.Text));
       Edit1.Text := tpath + '_' + ExtractFileName(Edit1.Text);
   finally
       QP.Free;
   end;

// Now i load my work-pdf.
// The direct-access-functions are not so
// cpu-hungry ;-)

   QP := TiSEDQuickPDF.Create;
   try
       QP.UnlockKey('MyKey');
       dafh := QP.DAOpenFile(Edit1.Text,'');
       x    := QP.DAGetPageCount(dafh);
       STR := '';

       verztxt := Edit1.Text + '.txt';
       AssignFile(cf,verztxt);
       Rewrite(cf);
       pc := 0;
       for i := 1 to x Do
       begin
          dapr := QP.DAFindPage(dafh,i);
          QP.CombineLayers;
          STR := QP.DAExtractPageText(dafh,dapr,3);

          WriteLn(cf,Trim(STR));

// We know that QP want more and more cpu-capacity
// if the pages are more and more ...
// So i've made every 10 pages a break starting new ...

          pc := pc + 1;
          if ( pc = 10 ) Then
             begin
               pc := 0;
               QP.DACloseFile(dafh);
               QP.Free;
               QP := TiSEDQuickPDF.Create;
               QP.UnlockKey('MyKey');
               dafh := QP.DAOpenFile(Edit1.Text,'');
              end;

       end;
    finally
       QP.DACloseFile(dafh);
       QP.Free;
       CloseFile(cf);
    end;

//==============================================

In file uPDFTrueTypeParser.pas i've made changes (which are included in the new 5.15 beta. With this changes i've got a good result extracting your sample.pdf:

unit uPDFTrueTypeParser;

// . . .

function IsString(const str: string): boolean;
var
len: integer;
p : PChar;
begin
len := length(str);
result := CompareMem( p, pchar(str), len);
inc(p, len);
end;

// . . .

procedure TPDFTrueTypeParser.LoadFromString(const Source: String);
var
SS: TStringStream;
begin
If not IsString(Source) Then //Schmoekel, 2006-10
     Exit;                     //Schmoekel, 2006-10
     
try

// . . .
Back to Top
Dmitry View Drop Down
Team Player
Team Player


Joined: 21 Sep 06
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmitry Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 06 at 3:22AM
Thanks, Ingo!
Please tell me when 5.15 version will released?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 06 at 5:20AM
Hi!

You can read here ... I can't look into the future ;-)
The first beta is released.

Best regards,
Ingo
Back to Top
Dmitry View Drop Down
Team Player
Team Player


Joined: 21 Sep 06
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmitry Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 06 at 5:52AM
Ok, I see.
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