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!
![]() |
Find a word in a PDF document and get X Y |
Post Reply ![]() |
Author | |
JMLM ![]() Team Player ![]() ![]() Joined: 26 Mar 13 Status: Offline Points: 40 |
![]() ![]() ![]() ![]() ![]() Posted: 07 May 13 at 11:30AM |
Hi,
Does it possible to find a specific word in a PDF and get it x y position ? Thanks. Jim
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Jim!
Yes. Use the text-extract functions with option 3 or 7. You can extract the text page by page and word by word with the position- and font-data in csv-format. Cheers, Ingo
|
|
![]() |
|
JMLM ![]() Team Player ![]() ![]() Joined: 26 Mar 13 Status: Offline Points: 40 |
![]() ![]() ![]() ![]() ![]() |
Thanks Ingo, very interressant.
|
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
The new TextBlocks functions will be a little easier to use as you do not need to parse the CSV string. Here is an example bit of code using the DA functions. QP.ExtractPageTextBlocks can be used with QP.LoadFromFile.
int fh = QP.DAOpenFile("in.pdf", ""); int ph = QP.DAFindPage(fh, 1); int textID = QP.DAExtractPageTextBlocks(fh, ph, 3); for (int i = 1; i <= QP.GetTextBlockCount(textID); i++) { string line = QP.GetTextBlockText(textID, i); OutputTxt.AppendText(line + "\n"); } QP.ReleaseTextBlocks(textID); QP.DACloseFile(fh); Andrew.
|
|
![]() |
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