Add a standard text or watermark image to a PDF file

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
barbaros_akkurt
Posts: 2
Joined: 2015-06-19T00:34:41-07:00
Authentication code: 6789

Add a standard text or watermark image to a PDF file

Post by barbaros_akkurt »

Hello,
The command I am using in a Python script is as follows:
"convert -density 150 -strip -interlace JPEG -compress JPEG -quality 60 -sharpen 0x1.0 -trim -fill grey -font Times-Bold -pointsize 10 -gravity South -layers composite -annotate +0+0 'ITU Mustafa Inan Kutuphanesi' %s %s"%(pdf_file, pdf_file)
It creates a text at the bottom. However, I would like also to learn how to add a watermark image (the image is a PNG file).
Questions:
1) What can be done to improve the command?
2) The error message goes like this:
convert.im6: missing Null Image List Separator layers Composite @ error/mogrify.c/MogrifyImageList/7941.
Thank you,
Barbaros, Istanbul/Turkey
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Add a standard text or watermark image to a PDF file

Post by fmw42 »

Use -composite not -layers composite. The "-layers" method, 'Composite' was added allowing you compose two completely separate sets of images (animations) together. Also put +repage after -trim. Put your input file right after convert.

see
http://www.imagemagick.org/Usage/anim_mods/#composite
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#watermark
http://www.imagemagick.org/Usage/crop/#crop_repage
barbaros_akkurt
Posts: 2
Joined: 2015-06-19T00:34:41-07:00
Authentication code: 6789

Re: Add a standard text or watermark image to a PDF file

Post by barbaros_akkurt »

Thank you for your reply. I will try the modified script and will try to tell about what happened. Regards, Barbaros
Post Reply