Hey all!
I'm trying to convert a particular PDF that is a combination of vector images + text into a raster image (preferrably PNG w/ an alpha layer), and it generally takes 80 seconds with the following command:
convert -density 300x300 "C:\im\files\pdfFile.pdf" -resize 180x180 -flatten -quality 100 -profile "C:\im\sRGB.icc" "C:\im\output\converted.png"
My bet is that the problem lies with the text in the file because of the font that is used -- probably causing a huge issue on the vector end of things.
Any suggestions for intermediate steps that could be used to cut the time it takes to successfully convert the file into an image?
Looking for 10 seconds or less total time, but honestly any improvement is welcomed at this point!
Here is the problematic file: https://drive.google.com/file/d/0B0HRnS ... sp=sharing
Thank you so much!
Certain PDFs giving the conversion trouble?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Certain PDFs giving the conversion trouble?
It is not your processing, but the file itself. Just reading it to get information takes a long time.
time identify cap.pdf
cap.pdf PDF 612x792 612x792+0+0 16-bit sRGB 50671B 0.000u 0:00.000
real 1m5.382s
user 1m4.830s
sys 0m0.451s
time identify cap.pdf
cap.pdf PDF 612x792 612x792+0+0 16-bit sRGB 50671B 0.000u 0:00.000
real 1m5.382s
user 1m4.830s
sys 0m0.451s
Re: Certain PDFs giving the conversion trouble?
Any idea why this might be the case? Again I'm assuming it's the font of the text that's causing the issue, because this will only cause problems with particular files, generally the ones with fonts that have more going on. I'm just hoping there's a way to get around this issue instead of having to just "deal with how long it takes".
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Certain PDFs giving the conversion trouble?
I do not know. Imagemagick handles PDFs though Ghostscript. So it is likely a Ghostscript font issue. Perhaps GS font library does not include that font. What font are you using?
Re: Certain PDFs giving the conversion trouble?
I turns out that Inkscape can actually do what I want it to do without any issues. Not sure why there's such a huge difference in the reading of the PDF, but I bet you'll right that it's a lack of the font. Though I feel like that would've been an error altogether. Or at least a notification that the font is not available, at the very least.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Certain PDFs giving the conversion trouble?
Perhaps GS tries to find a substitute font (without notice) and searches a long time to find one that is close.
Re: Certain PDFs giving the conversion trouble?
Huh. Interesting way to go about it, I suppose. But again I feel like it should be noted to include some kind of notification that this sort of thing is being done - to help people figure out *why* something is taking so absurdly long to run.
Thanks for the help!
Thanks for the help!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Certain PDFs giving the conversion trouble?
You would have to contact the Ghostscript developers. Imagemagick just uses it and has no control over its error messages.