Page 1 of 1
pdf to jpeg conversion usin imagick
Posted: 2015-06-29T04:36:19-07:00
by niyas
I can compress a .jpg through browser as well as command prompt... but i can't convert a pdf to jpeg through browser . getting error Last OS error: No such file or directory..
System config
............................
windows server2008R2 and iis
php 5.5.11
Re: pdf to jpeg conversion usin imagick
Posted: 2015-09-17T06:09:29-07:00
by Memtimin
maybe it is helpfull for you.
#include <Magick++.h>
#include <string>
#include <iostream>
#include <sstream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
vector<Image> imageList;
readImages( &imageList, "doc1.PDF" );
//
//for (int i = 0; i < imageList.size(); i++)
for (int i = 0; i < 10; i++) {
stringstream fileName;
fileName<<"FAX" << i << ".JPEG";
imageList.resolutionUnits(PixelsPerInchResolution);
imageList.density(Geometry(150,150)); // could also use image.density("150x150")
imageList.write(fileName.str());
}
return 0;
}
Re: pdf to jpeg conversion usin imagick
Posted: 2015-09-17T08:14:28-07:00
by snibgo
Does the file doc1.PDF exist?
ImageMagick uses Ghostscript as a delegate to read PDF images. Is GS installed?
Does your conversion work at the command level?