ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 for-loop PDF lines
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

135 Posts

Posted - Feb 08 2023 :  14:01:02  Show Profile  Reply
Hi,

is there a way to loop the lines of a PDF page getting line index and length?

Al

xequte

38654 Posts

Posted - Feb 08 2023 :  21:19:09  Show Profile  Reply
Hi Al

Only something like:

var
  idx, outIndex, outLength: Integer;
  s: String;
begin
  Memo1.Clear;
  idx := 0;
  While idx < MAXINT do // Infinite loop
  begin
    ImageEnView1.PdfViewer.CharIndexToLine( idx, outIndex, outLength );
    if outLength = 0 then
      BREAK;
    s := ImageEnView1.PdfViewer.GetText( outIndex, outLength );
    memo1.Lines.Add( outIndex.ToString + ',' + outLength.ToString + ': ' + Trim( s ));
    idx := outIndex + outLength + 1;
  end;
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

aleatprog

135 Posts

Posted - Feb 10 2023 :  07:48:14  Show Profile  Reply
Hi Nigel,

the code works perfectly. Thank you. : )

Al
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: