Page 1 of 1

new pdf:version option

Posted: 2020-03-31T08:01:15-07:00
by Kolapsrebel
Hi there,
I saw that you've recently added an option in 7.0.10-1 to specify the pdf:version to use in output of a conversion.
I'm very interested as I need to provide pdf v1.4 to my printer, so I've tried a bit around this option, running on Version: ImageMagick 7.0.10-2 Q16 x86_64 2020-03-22.
However it doesn't seems to work every time.

I have two different jpg images that I convert to pdf with command :

Code: Select all

magick -density 300 -define pdf:version=1.4 <NAME>.jpg <NAME>.pdf
nature.jpg is converted to pdf 1.4, but isola.jpg is converted to pdf 1.7

The truth is that I first have a pdf : isola.pdf (wich is in v1.4) that I want to flatten (in order to convert the vector font to image) into another pdf v1.4.
but the direct command from pdf to pdf generates a pdf v1.7 even if I specify -define pdf:version=1.4 :

Code: Select all

magick -density 300 -define pdf:version=1.4 isola.pdf isola-flatten.pdf
So, as I saw that converting to pdf v1.4 from jpeg works with nature.jpg. I tried to first flatten my isola.pdf into isola.jpg, then convert isola.jpg to pdf v1.4, but the conversion still generate a pdf v1.7

Here are links to source files :


Re: new pdf:version option

Posted: 2020-03-31T08:32:26-07:00
by dlemstra
That option can only be used to "upgrade" the version and not to choose a lower one than required. Your image contains a color profile and that is why it is upgraded to version 1.7. Maybe we could change our code to ignore the color profile if a lower version is provided but we will need to investigate that.

Re: new pdf:version option

Posted: 2020-03-31T16:15:35-07:00
by magick
Try this command:

Code: Select all

magick -density 300 isola.pdf -strip -define pdf:version=1.4 isola-flatten.pdf

Re: new pdf:version option [resolved]

Posted: 2020-04-01T06:55:19-07:00
by Kolapsrebel
Thanks for you answers.
Stripping the metadata before generating the pdf works and generate a pdf v1.4 that seems to be correct.
I'll now dig into the impact of stripping this embeded color profile, but that's another subject.
Thanks. :)