[poppler] Poppler::renderToImage() error
alessandro mason
mason.alessandro.pec at gmail.com
Thu May 26 23:14:50 PDT 2011
I've made some experiments and the program creates the document. If I keep
the image size of the tmp Qimage with the PageSize() method returns 0. then
I think that the problem is when the program chooses the page from the
document->page() method or when creates the QImage from the
page->renderToImage method.
2011/5/26 Albert Astals Cid <aacid at kde.org>
> A Thursday, May 26, 2011, alessandro mason va escriure:
> > Hi,
> > I made a patch for PureData tha includes this code:
> >
> > poppler::poppler()
> > {
> > //ctor
> > }
> > poppler::poppler(const char* file)
> > {//ctor
> > loaded=loadedpage=save=true;
> > document= Poppler::Document::load(file);//open the document file
> > if (!document || document->isLocked()) {
> > loaded=false;
> > delete document;
> > }
> >
> > }//end cosntructor
> >
> > void poppler::selPage(int page){
> > poppler::pdfPage=document->page(1); // Document starts at page 0
> > if (pdfPage == 0) {
> > loadedpage=false;
> > }
> > // Generate a QImage of the rendered page
> > loaded=true;
> > tmp = poppler::pdfPage->renderToImage(72,72,-1,-1,-1,-1);//
> > if (tmp.isNull()) {
> > loaded=false;
> > }
> >
> > filename=QString("page.bmp");
> > save=tmp.save(filename,"BMP",50);//savepage
> >
> > }
> >
> > poppler::~poppler()
> > {
> > //dtor
> > delete poppler::pdfPage;
> > delete poppler::document;
> > }
> >
> > With Debian this code works, but now with Ubuntu 11.4 doesn't work
> because
> > it doesn't save the image.
> > Can anyone help me?
>
> Can you give more data? You have some variables there to check for errors,
> is
> any of them failing?
>
> Albert
>
> > Sorry for my english
> >
> > Mason Alessandro
> _______________________________________________
> 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/20110527/2521e122/attachment.html>
More information about the poppler
mailing list