Page 1 of 1

Change colors on PDF file

Posted: 2010-03-25T18:06:10-07:00
by marcoslavorato
Hello all. I am new using ImageMagick, so I have a got a problem today. I have a PDF generated dynamically, and I need change the color of some elements on first page. It's a vector. How can i change this color? I tried so many times with examples, but any works.

My last try is with this code:

Code: Select all

exec('convert generated-1.pdf -colorspace RGB –fill yellow -fuzz 10% –bordercolor "RGB(0,0,0)" –draw "color 395,95 filltoborder" langlang22.png',$result);
On my PDF I have the #00000 color and I want change this color to yellow.

Re: Change colors on PDF file

Posted: 2010-03-25T18:18:08-07:00
by fmw42
if pdf is in rgb colorspace and has no transparency, then

convert image.pdf[0] -fill yellow -opaque black newimage.png

the [0] will select only the first page and the newimage will only be the result for the first page

Re: Change colors on PDF file

Posted: 2010-03-28T07:05:37-07:00
by marcoslavorato
Really thanks. Worked fine for me.