I use the imagemagick++ API in my C++ programm. Readimage is used to read a multi-pages PDF file. But the resolution of the output image is too low.
vector<Image> imageList;
readImages( &imageList, "E:/ww.pdf" );
for(int i = 0; i < imageList.size(); i++)
{imageList.density("300");}
writeImages( imageList.begin(), imageList.end(), "D:/yes.tif" );
Is there some solutions to improve the resolution.
Readimage low resolution C++
-
- Posts: 1
- Joined: 2013-05-17T00:55:13-07:00
- Authentication code: 6789
Re: Readimage low resolution C++
You need to assign the density before reading the image. You cannot do that with readImages right now. But if you inline the content of readImages it can be done:
Code: Select all
// Not tested:
MagickCore::ImageInfo *imageInfo = MagickCore::CloneImageInfo(0);
std::string imageSpec = "E:/ww.pdf";
imageSpec.copy(imageInfo->filename, MaxTextExtent-1);
imageInfo->filename[imageSpec.length()] = 0;
MagickCore::CloneString(&imageInfo->density, "300");
MagickCore::ExceptionInfo exceptionInfo;
MagickCore::GetExceptionInfo(&exceptionInfo);
MagickCore::Image* images = MagickCore::ReadImage(imageInfo, &exceptionInfo);
MagickCore::DestroyImageInfo(imageInfo);
Magick::insertImages(imageList, images);
Magick::throwException(exceptionInfo);
MagickCore::DestroyExceptionInfo(&exceptionInfo);