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 - get the lines where a word belongs to
  FAQ FAQ  Forum Search   Register Register  Login Login

get the lines where a word belongs to

 Post Reply Post Reply
Author
Message
johnny View Drop Down
Beginner
Beginner
Avatar

Joined: 08 May 19
Location: Earth
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnny Quote  Post ReplyReply Direct Link To This Post Topic: get the lines where a word belongs to
    Posted: 12 Jun 19 at 4:23PM
hi all,

with the .GetPageText(4) you get the coordinates of the word.
so far so good, but i wish to get also the Line where this word belongs to if i had converted that pdf to a text file by using the .GetPageText(7).

anything out there ready that will do that, and not spend time coding my own function to locate the words in the text file? Embarrassed

thanks
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: 12 Jun 19 at 7:21PM
Hi Johnny,

there isn't a ready-made routine here i fear ;-)
But it's not hard stuff.
With option 3 or 4 you can sort the extract with the first Y-value.
Similar Y-values means the same line if font height matches.
Using option 7 you can put the extract into a memo-field:
Here's something from scratch (a bit delphi)...
memo_page := TStringList.Create;
for i := 1 to QP.PageCount do...
  QP.SelectPage(i):
  memo_page.Clear;
  memo_page.Text := QP.GetPageText;
  for i2 := 0 to memo_page.Count - 1 do
// ...


Cheers,
Ingo

Back to Top
johnny View Drop Down
Beginner
Beginner
Avatar

Joined: 08 May 19
Location: Earth
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnny Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 19 at 7:28PM
thanks for the reply... i have in the meantime done something similar... but it didn't hurt to ask...

for me the tricky part is that 1 word can be repeatable in many lines or in the same line and i should keep a dictionary of what i have already spotted in the text get its line..and move one.

also note to others to split the text you get.from getpagetxt(7) by "/n" char and before than get rid of the "/r" cause together in .net c#'s newLine will give you double the empty lines than it should be so lines you see and lines you get would not match..


anyway all good. would be nice though option 4 to provide that Line info in a future version... :)

bb
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: 12 Jun 19 at 10:12PM
"...
anyway all good. would be nice though option 4 to provide that Line info in a future version... :)
..."

So you should tell it to the publishers on their official page ;-)

Cheers,
Ingo

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