Page 1 of 1

add padding to texts with convert

Posted: 2016-04-25T23:28:03-07:00
by suman114
I am adding text with annotate, but the text is not centered and attached to the top.
Also how do we add a padding to increase the background size and center the text?
My command is:

Code: Select all

convert myPdf.pdf -gravity southwest -fill "rgba(0,0,0,0.80)" -pointsize 10 -annotate +0+0 "This is my text." compose -multiply myDestination.pdf

Re: add padding to texts with convert

Posted: 2016-04-26T07:23:37-07:00
by snibgo
Use a different gravity, eg "North" or "Centre".

What padding do you want to increase?

Your final "compose -multiply" is strange. Perhaps you intended "-compose multiply", but is isn't followed by anything that would be affected.

Re: add padding to texts with convert

Posted: 2016-04-26T08:56:31-07:00
by fmw42
I would suggest you create a text image using label: or caption: with a given background and -gravity center, trim it, then pad with the background color, then composite it over your other image at the desired location. See http://www.imagemagick.org/Usage/text/