Adding rectangle at bottom of page

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
suman114
Posts: 13
Joined: 2016-04-17T23:51:39-07:00
Authentication code: 1151

Adding rectangle at bottom of page

Post by suman114 »

How do I add a rectangle with white transparent background at the bottom of a page?

I am annonating a text and want to enclose it with a semi-transparent rectangle.

Code: Select all

convert file.pdf -gravity southwest -quality 100 -fill "rgba(0,0,0,0.5)" -pointsize 10 -weight bold -annotate +0+0 'my text' new.pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Adding rectangle at bottom of page

Post by fmw42 »

quality does not affect PDF files. It is density and it should come before the input pdf file. try

Code: Select all

convert -density XX file.pdf -gravity south -bacgkround "rgba(255,255,255,0.5) -splice YY -gravity southwest -fill "rgba(0,0,0,0.5)" -pointsize 10 -weight bold -annotate +0+0 'my text' new.pdf
Adjust XX from nominal 72 dpi to what you want in terms of size of the input pdf. Adjust YY for the size of the half transparent white border at the bottom.
Post Reply