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!
![]() |
Text Extraction |
Post Reply
|
| Author | |
rnw
Beginner
Joined: 19 Jan 12 Location: usa Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: Text ExtractionPosted: 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
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
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().
|
|
![]() |
|
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