<br>Hi Carlos Garcia Campos,<br><br>    You mentioned about the new function &quot;poppler_page_get_bounding_box()&quot;. It returns the effective bounding box of the page. What do you mean by effective bounding box? Is it the page bounding box excluding the margins on left,right,top,bottom ? If So, I am also trying the same thing for getting the bounding box of the page.<br>
<br>         I need some suggestions. Iam doing something like this <br>  1) we have the way to get the TextBlocks bounding boxes from the TextOutPutDev file. Taking the minX,minY,maxX,maxY of all TextBlocks bounding box will give the page bounding box excluding margins. But some pdf files having Graphic Streams at the start and end of the pages. For those pages it wil not give the correct bounding box. Give me any ideas how to do those.<br>
<br>  2) In poppler_page_get_image_mapping() it will give the starting (x,y) co-ordinates and width,height of the image. But how do we know scaling factor of the image stored in the file. ( this is for all)<br><br>Thanks &amp; Regards<br>
<br>--<br>A Srinivas<br><br><br>       <br><br><div class="gmail_quote">On Wed, Jun 16, 2010 at 12:30 AM,  <span dir="ltr">&lt;<a href="mailto:poppler-request@lists.freedesktop.org">poppler-request@lists.freedesktop.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send poppler mailing list submissions to<br>
        <a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.freedesktop.org/mailman/listinfo/poppler" target="_blank">http://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:poppler-request@lists.freedesktop.org">poppler-request@lists.freedesktop.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:poppler-owner@lists.freedesktop.org">poppler-owner@lists.freedesktop.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of poppler digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. glib/poppler-document.cc glib/poppler-page.cc<br>
      (Carlos Garcia Campos)<br>
   2. Re: KMP for search (Albert Astals Cid)<br>
   3. Changes and possible api break in glib frontend for 0.16<br>
      (Carlos Garcia Campos)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 15 Jun 2010 08:45:41 -0700 (PDT)<br>
From: <a href="mailto:carlosgc@kemper.freedesktop.org">carlosgc@kemper.freedesktop.org</a> (Carlos Garcia Campos)<br>
Subject: [poppler] glib/poppler-document.cc glib/poppler-page.cc<br>
To: <a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
Message-ID: &lt;<a href="mailto:20100615154542.6AB4B10057@kemper.freedesktop.org">20100615154542.6AB4B10057@kemper.freedesktop.org</a>&gt;<br>
<br>
 glib/poppler-document.cc |   12 ++++++------<br>
 glib/poppler-page.cc     |   17 ++++++++++-------<br>
 2 files changed, 16 insertions(+), 13 deletions(-)<br>
<br>
New commits:<br>
commit 25494311c5b8eb88d43df420ec91a1aedad20d05<br>
Author: Carlos Garcia Campos &lt;<a href="mailto:carlosgc@gnome.org">carlosgc@gnome.org</a>&gt;<br>
Date:   Tue Jun 15 17:44:23 2010 +0200<br>
<br>
    [glib] Add some G_UNLIKELY()<br>
<br>
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc<br>
index 76a05a1..b265a34 100644<br>
--- a/glib/poppler-document.cc<br>
+++ b/glib/poppler-document.cc<br>
@@ -1171,7 +1171,7 @@ poppler_index_iter_next (PopplerIndexIter *iter)<br>
 void<br>
 poppler_index_iter_free (PopplerIndexIter *iter)<br>
 {<br>
-       if (iter == NULL)<br>
+       if (G_UNLIKELY (iter == NULL))<br>
                return;<br>
<br>
        g_object_unref (iter-&gt;document);<br>
@@ -1305,7 +1305,7 @@ poppler_fonts_iter_copy (PopplerFontsIter *iter)<br>
 void<br>
 poppler_fonts_iter_free (PopplerFontsIter *iter)<br>
 {<br>
-       if (iter == NULL)<br>
+       if (G_UNLIKELY (iter == NULL))<br>
                return;<br>
<br>
        deleteGooList (iter-&gt;items, FontInfo);<br>
@@ -1424,7 +1424,7 @@ layer_new (OptionalContentGroup *oc)<br>
 static void<br>
 layer_free (Layer *layer)<br>
 {<br>
-  if (!layer)<br>
+  if (G_UNLIKELY (!layer))<br>
     return;<br>
<br>
   if (layer-&gt;kids) {<br>
@@ -1589,8 +1589,8 @@ _poppler_document_get_layers (PopplerDocument *document)<br>
 static void<br>
 poppler_document_layers_free (PopplerDocument *document)<br>
 {<br>
-  if (!document-&gt;layers)<br>
-         return;<br>
+  if (G_UNLIKELY (!document-&gt;layers))<br>
+    return;<br>
<br>
   g_list_foreach (document-&gt;layers, (GFunc)layer_free, NULL);<br>
   g_list_free (document-&gt;layers);<br>
@@ -1644,7 +1644,7 @@ poppler_layers_iter_copy (PopplerLayersIter *iter)<br>
 void<br>
 poppler_layers_iter_free (PopplerLayersIter *iter)<br>
 {<br>
-  if (iter == NULL)<br>
+  if (G_UNLIKELY (iter == NULL))<br>
     return;<br>
<br>
   g_object_unref (iter-&gt;document);<br>
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc<br>
index 14601a6..19ea941 100644<br>
--- a/glib/poppler-page.cc<br>
+++ b/glib/poppler-page.cc<br>
@@ -891,7 +891,7 @@ poppler_page_get_selection_region (PopplerPage           *page,<br>
 void<br>
 poppler_page_selection_region_free (GList *region)<br>
 {<br>
-  if (!region)<br>
+  if (G_UNLIKELY (!region))<br>
     return;<br>
<br>
   g_list_foreach (region, (GFunc)poppler_rectangle_free, NULL);<br>
@@ -1137,7 +1137,7 @@ poppler_page_get_image (PopplerPage *page,<br>
 void<br>
 poppler_page_free_image_mapping (GList *list)<br>
 {<br>
-  if (list == NULL)<br>
+  if (G_UNLIKELY (list == NULL))<br>
     return;<br>
<br>
   g_list_foreach (list, (GFunc)poppler_image_mapping_free, NULL);<br>
@@ -1317,7 +1317,7 @@ poppler_page_get_link_mapping (PopplerPage *page)<br>
 void<br>
 poppler_page_free_link_mapping (GList *list)<br>
 {<br>
-  if (list == NULL)<br>
+  if (G_UNLIKELY (list == NULL))<br>
     return;<br>
<br>
   g_list_foreach (list, (GFunc)poppler_link_mapping_free, NULL);<br>
@@ -1380,7 +1380,7 @@ poppler_page_get_form_field_mapping (PopplerPage *page)<br>
 void<br>
 poppler_page_free_form_field_mapping (GList *list)<br>
 {<br>
-  if (list == NULL)<br>
+  if (G_UNLIKELY (list == NULL))<br>
     return;<br>
<br>
   g_list_foreach (list, (GFunc) poppler_form_field_mapping_free, NULL);<br>
@@ -1507,7 +1507,7 @@ poppler_page_get_annot_mapping (PopplerPage *page)<br>
 void<br>
 poppler_page_free_annot_mapping (GList *list)<br>
 {<br>
-  if (!list)<br>
+  if (G_UNLIKELY (!list))<br>
     return;<br>
<br>
   g_list_foreach (list, (GFunc)poppler_annot_mapping_free, NULL);<br>
@@ -1593,6 +1593,9 @@ poppler_link_mapping_copy (PopplerLinkMapping *mapping)<br>
 void<br>
 poppler_link_mapping_free (PopplerLinkMapping *mapping)<br>
 {<br>
+  if (G_UNLIKELY (!mapping))<br>
+    return;<br>
+<br>
   if (mapping-&gt;action)<br>
     poppler_action_free (mapping-&gt;action);<br>
<br>
@@ -1677,7 +1680,7 @@ poppler_form_field_mapping_copy (PopplerFormFieldMapping *mapping)<br>
 void<br>
 poppler_form_field_mapping_free (PopplerFormFieldMapping *mapping)<br>
 {<br>
-  if (!mapping)<br>
+  if (G_UNLIKELY (!mapping))<br>
     return;<br>
<br>
   if (mapping-&gt;field)<br>
@@ -1713,7 +1716,7 @@ poppler_annot_mapping_copy (PopplerAnnotMapping *mapping)<br>
 void<br>
 poppler_annot_mapping_free (PopplerAnnotMapping *mapping)<br>
 {<br>
-  if (!mapping)<br>
+  if (G_UNLIKELY (!mapping))<br>
     return;<br>
<br>
   if (mapping-&gt;annot)<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 15 Jun 2010 19:05:25 +0100<br>
From: Albert Astals Cid &lt;<a href="mailto:aacid@kde.org">aacid@kde.org</a>&gt;<br>
Subject: Re: [poppler] KMP for search<br>
To: <a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
Message-ID: &lt;<a href="mailto:201006151905.25318.aacid@kde.org">201006151905.25318.aacid@kde.org</a>&gt;<br>
Content-Type: Text/Plain;  charset=&quot;us-ascii&quot;<br>
<br>
A Dimarts, 15 de juny de 2010, Johannes Buchner va escriure:<br>
&gt; Hi!<br>
<br>
Hi<br>
<br>
&gt; I implemented the KMP search algorithm in [1] but I feel it doesn&#39;t<br>
&gt; get attention. Please apply [2] and test it.<br>
<br>
You sent a mail yesterday and already complain you are being ignored?<br>
<br>
&gt;<br>
&gt; [1] <a href="https://bugs.freedesktop.org/show_bug.cgi?id=8821" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=8821</a><br>
&gt; [2] <a href="https://bugs.freedesktop.org/attachment.cgi?id=36255" target="_blank">https://bugs.freedesktop.org/attachment.cgi?id=36255</a><br>
&gt;<br>
&gt; To be honest, the gain is small;<br>
<br>
If the gain is small i&#39;d prefer to stay with our tested code than to switch to<br>
something totally new.<br>
<br>
&gt; I find it odd that the search<br>
&gt; function is page-based and runs per block (sorry, I&#39;m new to poppler).<br>
&gt; It strikes me that no wrapped words can ever be found.<br>
&gt;<br>
&gt; Perhaps it would also make sense to put a &#39;#pragma omp for&#39; in front of<br>
&gt; the whole-document search? (For those not familiar with OpenMP,<br>
&gt; this simply parallizes the search over the available CPUs.)<br>
<br>
I don&#39;t think depending on OpenMP is an option.<br>
<br>
Albert<br>
<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Johannes<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 15 Jun 2010 20:44:50 +0200<br>
From: Carlos Garcia Campos &lt;<a href="mailto:carlosgc@gnome.org">carlosgc@gnome.org</a>&gt;<br>
Subject: [poppler] Changes and possible api break in glib frontend for<br>
        0.16<br>
To: poppler &lt;<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a>&gt;<br>
Message-ID: &lt;1276617261-sup-4132@charmaleon&gt;<br>
Content-Type: text/plain; charset=&quot;utf8&quot;<br>
<br>
Hi all,<br>
<br>
there are some planned changes and possible api breakages for this<br>
devel cycle that I would like to comment here.<br>
<br>
 - The GDK api will be marked as deprecated for 0.16 and definitely<br>
 removed in 0.17/0.18. In this moment GDK api is just a wrapper over<br>
 the cairo one, so it doesn&#39;t make sense to depend on gdk just for<br>
 that.<br>
<br>
 - poppler_page_get_selection_region(). This method was already<br>
 changed to return a GList * of PopplerRectangles instead of a<br>
 GdkRegion when we made gdk an optional dependency. Now that gdk<br>
 api is deprecated it probably makes sense to return a cairo_region_t<br>
 * instead. The main problem is that cairo_region is cairo 1.10 api, so<br>
 we need to trust it will be released on August as planned.<br>
<br>
 - poppler_page_get_text(). This method is confusing, it receives a<br>
 PopplerRectangle and PopplerSelectionStyle, so I think it might be<br>
 renamed to poppler_page_get_selected_text(), since it actually<br>
 returns the text contained in the selection contained in the given<br>
 rectangle. Then we can add poppler_page_get_text() as convenient<br>
 method to get the whole text of the page.<br>
<br>
 - poppler_page_get_text_layout(). Daniel Garcia is already working on<br>
 this. It returns an array of PopplerRectangles that are the bounding<br>
 boxes of every character in the page. The array index is the<br>
 character offset of the string returned by (the new)<br>
 poppler_page_get_text().<br>
<br>
 - printing options. I would like to add a way to specify options when<br>
 rendering for printing, like not rendering annotations. We could add<br>
 an options parameter to poppler_page_render_for_printing() or maybe<br>
 we can avoid breaking the api and just add<br>
 poppler_page_render_for_printing_with_options().<br>
<br>
 - In PopplerDocument, linearized property is an string containing<br>
 &quot;Yes&quot; or &quot;No&quot;, it should be a boolean. I plan to add accessors for<br>
 all properties in PopplerDocument and PopplerPage, to make properties<br>
 easier to discover.<br>
<br>
 - poppler_page_get_bounding_box(). This will be a new method that<br>
 returns the effective bounding box of the page. It would allow<br>
 viewers to implement fit-to-contents zoom as well as FitB*<br>
 destinations. This needs cairo 1.10 (recording surface)<br>
<br>
 - GObject introspection support.<br>
<br>
I think I don&#39;t forget anything. Comments? Objections?<br>
<br>
Regards,<br>
--<br>
Carlos Garcia Campos<br>
PGP key: <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x523E6462" target="_blank">http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x523E6462</a><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: signature.asc<br>
Type: application/pgp-signature<br>
Size: 198 bytes<br>
Desc: not available<br>
URL: &lt;<a href="http://lists.freedesktop.org/archives/poppler/attachments/20100615/2994e31e/attachment-0001.pgp" target="_blank">http://lists.freedesktop.org/archives/poppler/attachments/20100615/2994e31e/attachment-0001.pgp</a>&gt;<br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
poppler mailing list<br>
<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/poppler" target="_blank">http://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
<br>
<br>
End of poppler Digest, Vol 64, Issue 23<br>
***************************************<br>
</blockquote></div><br>