pdf to jpeg conversion usin imagick

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
niyas
Posts: 2
Joined: 2015-06-29T03:36:10-07:00
Authentication code: 6789

pdf to jpeg conversion usin imagick

Post 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
Memtimin
Posts: 3
Joined: 2015-09-16T13:04:27-07:00
Authentication code: 1151

Re: pdf to jpeg conversion usin imagick

Post 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;
}
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: pdf to jpeg conversion usin imagick

Post 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?

Code: Select all

convert doc1.PDF FAX1.JPEG
snibgo's IM pages: im.snibgo.com
Post Reply