Hi,
I need convert a PDF into an image for my app developed in C++.
I have no trouble to convert the PDF into the image but I need also to turn-off the antialias.
It is possible?
Here my simple code:
int main( int argc, char ** argv)
{
InitializeMagick(*argv);
Image * img = new Image();
img->density("100");
img->strokeAntiAlias(false); //This is wrong! It doesn't work!
img->read("input.pdf");
img->write("output.bmp");
return 0;
}
Thanks
load a PDF without antialiasing
-
- Posts: 4
- Joined: 2016-07-22T04:58:24-07:00
- Authentication code: 1151
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: load a PDF without antialiasing
IM delegates the rasterising of PDFs to Ghostscript. "-verbose" shows it gives the same command to GS regardless of the antialias setting.
I don't know if GS has an option for turning off anti-aliasing. If it does, you could ask for that feature to be added to IM, and for a workaround you could change delegates.xml.
I don't know if GS has an option for turning off anti-aliasing. If it does, you could ask for that feature to be added to IM, and for a workaround you could change delegates.xml.
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2016-07-22T04:58:24-07:00
- Authentication code: 1151
Re: load a PDF without antialiasing
Probably GS has the option that I need. Because if I run:
convert -density 100 -background white -flatten +antialias input.pdf output.bmp
it works fine. Exactly what I need.
But I can't reproduce this in my c++ code.
Thanks
convert -density 100 -background white -flatten +antialias input.pdf output.bmp
it works fine. Exactly what I need.
But I can't reproduce this in my c++ code.
Thanks
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: load a PDF without antialiasing
Oh, good. Why are you using strokeAntiAlias? The doc http://www.imagemagick.org/Magick++/Image++.html says this is for "drawing object outlines". For "antialiasing of rendered Postscript and Postscript or TrueType fonts", the doc says this is antiAlias.
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2016-07-22T04:58:24-07:00
- Authentication code: 1151
Re: load a PDF without antialiasing
also:
does't work in my case...
Code: Select all
img->antiAlias(false);
-
- Posts: 4
- Joined: 2016-07-22T04:58:24-07:00
- Authentication code: 1151
Re: load a PDF without antialiasing
Hi,
I have not yet found a solution. Could be my problem a small bug of the library?
Thanks
I have not yet found a solution. Could be my problem a small bug of the library?
Thanks