PDF tags

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
pernajz

PDF tags

Post by pernajz »

Hello,

I'm converting jpeg images into PDF via ImageMagick. It works absouletely perfectly, if i use some options (-density, -geometry, etc.). But there's problem in result PDF's properties.

I need to remove message "Created by ImageMagick, http://www.imagemagick.org

Any way to do this?

Many thanks for help.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PDF tags

Post by magick »

To remove the producer statement, edit the ImageMagick source coders/pdf.c and remove or comment out these lines:

Code: Select all

  (void) FormatMagickString(buffer,MaxTextExtent,"/Producer (%s)\n",
    EscapeParenthesis(GetMagickVersion((unsigned long *) NULL)));
  (void) WriteBlobString(image,buffer);
Now rebuild and reinstall ImageMagick.
pernajz

Re: PDF tags

Post by pernajz »

Well,

thanks for amazingly quick reply.
EvgeniyK
Posts: 1
Joined: 2018-02-11T03:13:11-07:00
Authentication code: 1152

Re: PDF tags

Post by EvgeniyK »

I'm sorry for necroposting here, but I need to solve this same problem on Windows where I have no means to recompile the binary. Is it possible nowadays to remove PDF Producer statement with some CLI option? I think this should be implemented somehow as this can easily reveal private directory names to the world.
I generate my PDF with:

Code: Select all

C:\temp\ImageMagick\magick convert 1.png 2.png -units PixelsPerInch -density 212x212 Cover.pdf
and get a PDF which has "PDF Producer" set to

Code: Select all

C:\temp\ImageMagick\\index.html
(two backslashes and index.html at the end).
I also experiment with the -set option but it either doesn't work or I use it wrong.

Code: Select all

C:\temp\ImageMagick\magick convert 1.png 2.png -units PixelsPerInch -density 212x212 -set "/Producer" "TestTestTest" Cover.pdf
I tried "/Producer", as this string is in coders/pdf.c code, and "Producer" too.

ImageMagick is 7.0.7-21-portable-Q16-x64 and I view PDF in Acrobat Reader DC 2018.009.20050.
Post Reply