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!
![]() |
DASetTextExtractionArea with different origin |
Post Reply ![]() |
Author | ||
Cirunz ![]() Beginner ![]() ![]() Joined: 18 Mar 14 Location: Rome Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 18 Mar 14 at 2:32PM |
|
Hi, I'm trying to extract text in a specific area, on a large number of pdf files.
My first approach is to loop for every file, open the file, select the page and proceed to extract the text with GetPageText: //Code to initialize dll reference DPDF
It works fine, but it's not very fast, and it uses lot of memory. Worried by this results, I choosed to give a try to the ExtractFilePageText, so to keep low CPU and memory occupation. So I've changed the above cycle in this way:
This does not find anything. There is a simple explanation for this: Documentation says DASetTextExtractionArea is relative to the bottom left corner of the page, and do no mention a way to make the SetOrigin (or the SetMeasurementUnits), affect this function. There is not a way to do so? The ExtractFilePageText can be only used with the default origin? Thank you. |
||
![]() |
||
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
|
Cirunz,
Yes. It is a complex thing to explain. The DA functions do not support the SetOrigin function as SetOrigin is not a DA supported functions. You cannot normally mix DA and non DA functions as they use different functions to process the file. The exception to this rule are that most of the Extract* functions do use the DA code and and not the non DA functions. You need to adjust the Y position by calling YPos := QP.DAGetPageHeight(dahandle, dapageref) - YPos; Andrew.
|
||
![]() |
||
Cirunz ![]() Beginner ![]() ![]() Joined: 18 Mar 14 Location: Rome Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you Andrew, this is really helpfull. I have a mixed scenario, so I will use this function to adjust the coordinates, depending on the case. Thanks again. Fabio.
|
||
![]() |
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