Page 1 of 1

How to add padding to a text?

Posted: 2016-04-26T22:23:58-07:00
by suman114
I want to add padding to a text in a pdf. Is there any way?

Code: Select all

convert file.pdf '-fill rgba(0,0,0,0.80) -undercolor #ffffff50 '-pointsize 10 '-weight bold '-draw "gravity southwest scale 1,0.8 fill black text 0,0 "My funny text" destination.pdf
I am literally stuck at it now

Re: How to add padding to a text?

Posted: 2016-04-26T23:57:02-07:00
by fmw42
Use label: to create a text image with your undercolor as background. Then trim it and pad with your undercolor. Then composite it over your background pdf where you want it.

See
http://www.imagemagick.org/Usage/text/
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/crop/#trim
http://www.imagemagick.org/Usage/crop/#border