[poppler] A question about PDFDoc::displayPage

Thomas Freitag thomas.freitag.bbr at gmail.com
Mon Sep 16 00:56:25 PDT 2013


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 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/c8af42b5/attachment.html>


More information about the poppler mailing list