Page 1 of 1

composite, adding watermark and speed

Posted: 2016-08-03T04:02:52-07:00
by ed44rf
i have a multypage pdf file, i need to put a watermark on each page in pdf. also i need to set opacity, size and position of watermark
it must work on linux command line
i googled but can't find any complete example, so i use such solution-split pdf on single page, then call command and put watermark on each pdf

Code: Select all

composite -gravity NorthEast -density 200 -dissolve 50 -size 50x30 -geometry +100+50 watermark.jpg pdf1.pdf pdf1.pdf 
then merge all files into 1 pdf
the main problem is the speed- if density is 100 or more then speed is slow, if lower then poor quality of pdf files
can you give some ideas?
may be any example to put watermark on whole pdf, or may be increase speed?

Re: composite, adding watermark and speed

Posted: 2016-08-03T07:24:32-07:00
by snibgo
See my response on a similar thread: viewtopic.php?f=27&t=30203

Re: composite, adding watermark and speed

Posted: 2016-08-03T09:55:52-07:00
by ed44rf
thanks, but this is the one way to set watermark with such params
is any way to increase speed with high quality?

Re: composite, adding watermark and speed

Posted: 2016-08-03T10:03:22-07:00
by snibgo
It depends on why you get "poor quality". If the input PDFs contain vector elements (such as plain text), then a speed/quality tradeoff is inevitable. If it contains only raster images, then I suggest you extract them with pdfimages, add your watermark to those, and reassemble into PDF files.

There are probably tools out there somewhere to add PNG watermarks to PDF files without rasterizing vectors.

Re: composite, adding watermark and speed

Posted: 2016-08-03T10:36:52-07:00
by ed44rf
pdf file contain just text
also i use command

Code: Select all

convert img pdf
and it work good

i googgled any other solutions but they not completed
for example mpdf can't change position of watermark (i need right top corner)