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!
![]() |
extract Text (words) |
Post Reply
|
| Author | |
munteanu24d
Beginner
Joined: 03 Sep 09 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: extract Text (words)Posted: 11 Sep 09 at 2:36PM |
|
hello!
I am trying to get the text from a pdf file, using the getPageText(option) method. I have tried option = 3 and option = 4. When I print the text obtained with option 3, I get just the first word from each row, but the coordinates of the whole row. When I print the text obtained with option 4, I get the fragmented piece of words, for instance for constant word, i get const and ant . I need implement the find word functionality, but I cannot do it, as long as instead of the whole word, i get fragment of words. What can I do? P.S. I have tried for different pdfs and the result is the same. best wishes, D.M. Edited by munteanu24d - 11 Sep 09 at 2:38PM |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 Sep 09 at 7:16PM |
|
Hi D.M.!
Option 3 gets strings if strings were inserted. It's not a must that the line of characters you can see in the pdf was inserted in one run. Another thing is: If there was one word missed in a pdf-row and if it was inserted later ... so this word would be extracted as the last content of the page 'cause it was inserted late and it doesn't matter to which row it belongs. If you get always one word with option 3 then i think that all pdf-documents are from the same source and that they are automatically generated. You can send two samples to me then we can examine them: ingo -dot- schmoekel -at- ewetel -dot- net The other way round i can send you a file with "longer" strings ;-) Cheers, Ingo |
|
![]() |
|
munteanu24d
Beginner
Joined: 03 Sep 09 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 Sep 09 at 10:30AM |
|
Thank you for your answer. I Have changed the pdf files, and now I am managing to search for words in the rows, with option 3.
What I do not manage to do is to take the char width. The _QP.CharWidth(myASCIcode) always returns a 0 value. I have checked the selected font ID and it is also 0. Here might be the problem, but i do not manage to fix it... :( Edited by munteanu24d - 15 Sep 09 at 10:31AM |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 Sep 09 at 11:48AM |
|
Hi!
With option=3 you get the value for font-height, too. With a bit calculations regarding the other values (from the four rectangles) you can get the complete length, too. If you want the character-length you can get the string-lenght with "len(...)", "length(...)" or any similar syntax in many languages. So you have the string-length and the height and it shouldn't be a big problem to find/calculate a matching factor for each character-width. Cheers, Ingo |
|
![]() |
|
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