Convert PDF to TIFF

May 15, 2013 at 1:31pm
I am developing a program that convert PDF files to TIFF files. I use imagemagick++ and can accomplish the concersion successfully. But the resolution of the multi-page TIFF files is too low. My code follows:

vector<Image> imageList;
for(int i = 0; i < imageList.size(); i++)
{
imageList[i].resolutionUnits(PixelsPerInchResolution);
imageList[i].density("300");
}
readImages( &imageList, "E:/gk11.pdf" );
writeImages( imageList.begin(), imageList.end(), "D:/gk11.tif" );

although I change the density in the code, but it seems don't work. Forwardding the solution. Thank you.
Last edited on May 16, 2013 at 1:05am
May 16, 2013 at 1:06am
Need your help!
May 16, 2013 at 1:10am
You should read the images before your loop. (As it is, your loop doesn't do anything, because your imageList is empty when you loop over it.)

I don't know anything about imagemagick++, BTW, so there might be other problems I don't see.
May 16, 2013 at 1:18am
Thank you, Duoas. I have moved the position of the loop. But the quanlity of the output image is still bad.

vector<Image> imageList;
readImages( &imageList, "E:/gk11.pdf" );

for(int i = 0; i < imageList.size(); i++)
{
imageList[i].resolutionUnits(PixelsPerInchResolution);
imageList[i].density("300");
}
writeImages( imageList.begin(), imageList.end(), "D:/gk11.tif" );
Last edited on May 16, 2013 at 1:19am
May 16, 2013 at 8:33pm
Are you sure that the quality of the images in the PDF are at least as good as the result you want?
May 17, 2013 at 6:06am
Yes, I'm sure. If I convert an one-page PDF to image using the following code:

Image image;
image.density("300");
image.read( "E:/test.pdf");
image.write("E:/test.tif");

The image is pertty as my expectation.
Last edited on May 17, 2013 at 6:06am
May 20, 2013 at 7:49am

I do this almost daily. I use a PDF converter driver found on the internet . Install it and it becomes a selectable converter option.Then you can convert PDFs to many forms in any program at all, including Adobe Acrobat . Just open a PDF, select convert, then you can convert pdf to tiff , and choice a form you want, the task will be finished in several seconds. if you haven't found a good choice , you can have a try. best wishes.
http://www.rasteredge.com/how-to/csharp-imaging/tiff-convert-pdf/
May 20, 2013 at 1:27pm
I don't know anything about imagemagick++ either, but the one thing differing between your list version and your single-image version is setting the resolution units. You set the value in the list version, but in the single-image version you use the default value, whatever it is. Try removing that line from the list version.
Last edited on May 20, 2013 at 1:27pm
Topic archived. No new replies allowed.