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!
get the lines where a word belongs to |
Post Reply |
Author | |
johnny
Beginner Joined: 08 May 19 Location: Earth Status: Offline Points: 17 |
Post Options
Thanks(0)
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? thanks
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
johnny
Beginner Joined: 08 May 19 Location: Earth Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
"...
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 |
|
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