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 - Find a word in a PDF document and get X Y
  FAQ FAQ  Forum Search   Register Register  Login Login

Find a word in a PDF document and get X Y

 Post Reply Post Reply
Author
Message
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Topic: Find a word in a PDF document and get X Y
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 13 at 11:39AM
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
Back to Top
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 13 at 9:08AM
Thanks Ingo, very interressant. 
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 13 at 1:48PM
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.
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