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 - Text Extraction
  FAQ FAQ  Forum Search   Register Register  Login Login

Text Extraction

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

Joined: 19 Jan 12
Location: usa
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote rnw Quote  Post ReplyReply Direct Link To This Post Topic: Text Extraction
    Posted: 19 Jan 12 at 4:52PM
I am using the following code to extract text from a pdf file in Visual Basic, and it works great.  But I can not figure out how to set the "text Extraction area" to only a portion of the pdf file, say like the firts 3 inches of the pdf file.
 
nPage = 1
strInputFilePath="c:\rnw.pdf"
tt = QP.LoadFromFile(strInputFilePath, “”)
strtext = QP.ExtractFilePageText(strInputFilePath, "", nPage, 8)
 
Any help on where to find this would be great.
 
Roger
 

 
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: 19 Jan 12 at 9:42PM
If you are using LoadFromFile then it would be better to use the GetPageText(8); call.

  nPage = 1
  strInputFilePath="c:\rnw.pdf"
  tt = QP.LoadFromFile(strInputFilePath, “”)

  QP.SelectPage(1);

  QP.SetOrigin(1);
  QP.SetTextExtractionArea(1, 1, QP.PageWidth(), 3 * 72);   // 72pts = 1 inch
  strText = QP.GetPageText(8);

Note: If you use the ExtractFilePageText call then it gets a little more complicated as you need to use the QP.DASetTextExtractionArea function and the native PDF coordinate system as SetOrigin doesn't work with the DA functions and you don't have access to the Page Height and Width until you open the file.  It is easier to work with the standard functions and GetPageText().
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