[poppler] Poppler::renderToImage() error
alessandro mason
mason.alessandro.pec at gmail.com
Thu May 26 07:42:36 PDT 2011
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?
Sorry for my english
Mason Alessandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110526/8fd09f41/attachment.html>
More information about the poppler
mailing list