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.<br>
<br><br><div class="gmail_quote">2011/5/26 Albert Astals Cid <span dir="ltr"><<a href="mailto:aacid@kde.org">aacid@kde.org</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
A Thursday, May 26, 2011, alessandro mason va escriure:<br>
<div><div></div><div class="h5">> Hi,<br>
> I made a patch for PureData tha includes this code:<br>
><br>
> poppler::poppler()<br>
> {<br>
> //ctor<br>
> }<br>
> poppler::poppler(const char* file)<br>
> {//ctor<br>
> loaded=loadedpage=save=true;<br>
> document= Poppler::Document::load(file);//open the document file<br>
> if (!document || document->isLocked()) {<br>
> loaded=false;<br>
> delete document;<br>
> }<br>
><br>
> }//end cosntructor<br>
><br>
> void poppler::selPage(int page){<br>
> poppler::pdfPage=document->page(1); // Document starts at page 0<br>
> if (pdfPage == 0) {<br>
> loadedpage=false;<br>
> }<br>
> // Generate a QImage of the rendered page<br>
> loaded=true;<br>
> tmp = poppler::pdfPage->renderToImage(72,72,-1,-1,-1,-1);//<br>
> if (tmp.isNull()) {<br>
> loaded=false;<br>
> }<br>
><br>
> filename=QString("page.bmp");<br>
> save=tmp.save(filename,"BMP",50);//savepage<br>
><br>
> }<br>
><br>
> poppler::~poppler()<br>
> {<br>
> //dtor<br>
> delete poppler::pdfPage;<br>
> delete poppler::document;<br>
> }<br>
><br>
> With Debian this code works, but now with Ubuntu 11.4 doesn't work because<br>
> it doesn't save the image.<br>
> Can anyone help me?<br>
<br>
</div></div>Can you give more data? You have some variables there to check for errors, is<br>
any of them failing?<br>
<br>
Albert<br>
<div class="im"><br>
> Sorry for my english<br>
><br>
> Mason Alessandro<br>
</div>_______________________________________________<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>
</blockquote></div><br>