[poppler] A question about PDFDoc::displayPage

Lu Wang coolwanglu at gmail.com
Mon Sep 16 01:13:45 PDT 2013


Hi Thomas,

   Thanks for your prompt reply!

   I actually want to go several passes over the pdf file, e.g. one pass
for text and another pass for image.

   The recursive calls are not essential, but might be a little bit
convenient in my case. But I'll just separate both calls then, since it is
not well protected by design.


   Thanks!


   regards,
   - Lu Wang


On Mon, Sep 16, 2013 at 3:56 PM, Thomas Freitag <
thomas.freitag.bbr at gmail.com> wrote:

>  Am 16.09.2013 09:41, schrieb Lu Wang:
>
>     Hi all,
>
>     I need to call PDFDoc::displayPage inside a call of displayPage,
> something like
>
> /////////////////////////////////////////////
>  class MyOutputDev1{
>  public:
> void startPage(){
>      MyOutputDev2 * dev;
>      doc->displayPage(dev, ...);
>  }
>  };
>
>  MyOutputDev1 * dev;
>  doc->displayPage(dev, ...);
> /////////////////////////////////////////////
>
>     Since PDFDoc::displayPage is not a `const` function, I'm not sure if
> there will be a problem to do like this, althought I guess so.
>
> I'm wondering, why You need that, but nevertheless, be careful, at least,
> if You call displayPage inside another call of displayPage: Since reading a
> document was not stateless in the past (stream handling! I'm not sure if
> Adam's last changes to make it thread safe heals it), You should at least
> use different instances of the output device and use copies of xref
> instances. Have a look into pdftoppm.cc in the USE_THREAD branches which
> makes page rendering thread safe!
>
> Cheers,
> Thomas
>
>
>     Can any one please help?
>
>
>     Thanks a lot!
>
>
>     regards,
>     - Lu Wang
>
>
>
>
> _______________________________________________
> poppler mailing listpoppler at lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/poppler
>
>
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20130916/15bc5574/attachment.html>


More information about the poppler mailing list