Page 1 of 1

change PDF font & background colour

Posted: 2020-01-17T04:25:30-07:00
by javibbg6
Hi there,

I have been looking for an answer on how to do this, i've tried several things, but none of them worked for me.

I have a pdf, with blue background and white font colour. It's about 60 pages, and i want to print it, so it would be a total waste of ink. Here's just one page sample of it:
https://drive.google.com/open?id=1w4yDH ... QqIby6v4Gy

So, I want to do the following:
1. Change font colour to black
2. Change background colour to white.

What would be the correct syntax?

I thought on doing something like this:
convert input.pdf FROM "#ffffff" TO "#000000" result.pdf

But any other way is welcome.

Thanks in advance!

Re: change PDF font & background colour

Posted: 2020-01-17T11:12:32-07:00
by fmw42
The syntax would be:

Code: Select all

convert input.pdf -alpha off -fuzz 10% -fill black -opaque white -fill white -opaque "rgb(7,25,58)" result.pdf
Note that ImageMagick uses Ghostscript to render PDF files as raster data. So you will lose all vector data in your new PDF. Adjust the fuzz value as desired. Add -density XXX before reading the input PDF for higher quality. Change convert to magick if using IM 7.

Re: change PDF font & background colour

Posted: 2020-01-18T03:09:33-07:00
by javibbg6
Awesome!!

Thanks Mr/Mrs fmw42! It works perfectly!