hello albert, marc, other friends,

i sincerely hope this message has at least a textual copy.

the patch i proposed is successfully bypassing the problem with text selection
for the case the entire page text is being asked (with get_text).

is there a chance my patch would enter git?
the patch is re-attached.

best regards,
alex

On 09/24/2011 02:38 PM, alex bodnaru wrote:
> On 09/24/2011 01:02 PM, Marc J. Driftmeyer wrote:
> 
>> Much better, thanks. lol.
>>
>> I don't mind off-green and off-yellow faintly in engineering paper, but not 
>> in
>> an email app.
> 
> now that it's readable ...
> 
> any idea about my question, marc?
> 
> alex
> 
>>
>> - Marc
>>
>> On 09/24/2011 01:55 AM, alex bodnaru wrote:
>>>
>>> On 09/24/2011 11:28 AM, Marc J. Driftmeyer wrote:
>>>
>>>> Alex,
>>>>
>>>> Is it all possible for you to change your background color from yellow to 
>>>> white?
>>>
>>> sorry marc. does it match your taste now ;) ?
>>>
>>> alex
>>>
>>>> Sincerely,
>>>>
>>>> Marc J. Driftmeyer
>>>>
>>>> On 09/24/2011 01:19 AM, alex bodnaru wrote:
>>>>>
>>>>>
>>>>> hello albert, other friends,
>>>>>
>>>>> about the "recent" defect, it got to me since the *recent* debian upgrade
>>>>> of libpoppler* from 0.12.4 strait to 0.16.7.
>>>>>
>>>>> after comparing the releases in between, i found the problem occured from
>>>>> 0.13.2 to 0.13.3. couldn't attach the diff, since the message seems to get
>>>>> scrubbed.
>>>>>
>>>>> i see it's a great update. any advice would be welcome.
>>>>>
>>>>> just please look at the glib/demo/poppler-glib-demo get text output from
>>>>> the attached pdf, even of the fist page.
>>>>>
>>>>>
>>>>> thanks in advance,
>>>>>
>>>>> alex
>>>>>
>>>>> On 09/18/2011 05:09 PM, Albert Astals Cid wrote:
>>>>>
>>>>>> Please do not email me, email the list.
>>>>>>
>>>>>> A Diumenge, 18 de setembre de 2011, vàreu escriure:
>>>>>>> On 09/18/2011 02:41 PM, Albert Astals Cid wrote:
>>>>>>>> A Diumenge, 18 de setembre de
>>>>>>>       2011, alex bodnaru vàreu escriure:
>>>>>>>
>>>>>>> hello friends,
>>>>>>>
>>>>>>>> Hi
>>>>>>> thanks a lot albert for considering my problem.
>>>>>> I am not considering your problem, I am complaining about the lack of 
>>>>>> information in your original mail ;-)
>>>>>>
>>>>>>> i'm using poppler through python (that invokes glib interface).
>>>>>>>
>>>>>>> a recent change (probably together with get_text separation) broke the 
>>>>>>> glib
>>>>>>> interface.
>>>>>>>
>>>>>>>> what does recent mean? 0.16.7? 0.17.x? git master?
>>>>>>> 0.16.7.
>>>>>> So 0.16.7 does not work, which is the version you know it works?
>>>>>>
>>>>>> Albert
>>>>>>
>>>>>> P.S: Would it be possible for you not to send HTML email?
>>>>>>
>>>>>>>> Albert
>>>>>>> thanks again,
>>>>>>> alex
>>>>>>>
>>>>>>> i can't load the entire page text with get_text (see the glib demo) of 
>>>>>>> one
>>>>>>> pdf i have, but pdftotext does output the entire text.
>>>>>>>
>>>>>>> my pdf is attached. i apology for the language, but i promise it's a non
>>>>>>> offending cadastre report. please see that not all text lines are being
>>>>>>> output by get_text.
>>>>>>>
>>>>>>> could you help?
>>>>>>>
>>>>>>> thanks in advance,
>>>>>>>
>>>>>>> alex
>>>>>>>
>>>>>>>       _______________________________________________
>>>>>>>
>>>>>>>       > poppler mailing list
>>>>>>>       > 
>>>>>>>       > [email protected]
>>>>>>>       > 
>>>>>>>       > http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>>> _______________________________________________
>>>>>> poppler mailing list
>>>>>> [email protected]
>>>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> poppler mailing list
>>>>> [email protected]
>>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>
>>>> -- 
>>>> Marc J. Driftmeyer
>>>> Email :: [email protected] <mailto:[email protected]>
>>>> Web :: http://www.reanimality.com
>>>> Cell :: (509) 435-5212
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> poppler mailing list
>>> [email protected]
>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>
>> -- 
>> Marc J. Driftmeyer
>> Email :: [email protected] <mailto:[email protected]>
>> Web :: http://www.reanimality.com
>> Cell :: (509) 435-5212
> 
> 

diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index 9850d44..63f9955 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -843,13 +843,21 @@ poppler_page_get_selected_text (PopplerPage          *page,
 char *
 poppler_page_get_text (PopplerPage *page)
 {
-  PopplerRectangle rectangle = {0, 0, 0, 0};
+  GooString *sel_text;
+  double width, height;
+  char *result;
+  TextPage *text;
 
   g_return_val_if_fail (POPPLER_IS_PAGE (page), NULL);
 
-  poppler_page_get_size (page, &rectangle.x2, &rectangle.y2);
+  poppler_page_get_size (page, &width, &height);
+
+  text = poppler_page_get_text_page (page);
+  sel_text = text->getText (0, 0, width, height);
+  result = g_strdup (sel_text->getCString ());
+  delete sel_text;
 
-  return poppler_page_get_selected_text (page, POPPLER_SELECTION_GLYPH, &rectangle);
+  return result;
 }
 
 /**
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to