Page 1 of 1

Add a standard text or watermark image to a PDF file

Posted: 2015-06-19T00:42:34-07:00
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

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

Posted: 2015-06-19T08:23:17-07:00
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

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

Posted: 2015-06-23T23:14:21-07:00
by barbaros_akkurt
Thank you for your reply. I will try the modified script and will try to tell about what happened. Regards, Barbaros