On Wed, 26 Sep 2012 23:48:30 +0000, James Gagney ci disse:
[...]
*vector* pdf background (meaning not *raster image*) in pdf files can be
easily changed in a couple of steps (see also my stackoverflow answer that
now I'll extend and improve
-
http://stackoverflow.com/questions/10856521/change-background-color-of-
pdf/10869208#10869208)
- PRELIMINAR CHECK:
open your pdf file with an editor able to show the internal pdf structure,
like
*notepad++*
-
http://notepad-plus-plus.org/download/v6.1.8.html
and verify if you can see code snippets like
0.000 0.000 0.000 rg (it means *black*)
1.000 1.000 1.000 rg (it means *white*)
and so on...
(code snippet can change, for instance, in pdf produced by openoffice
internal pdf exporting feature, the same code snippepts are in this forms:
0 0 0 rg (it means *black*)
1 1 1 rg (it means *white*)
and so on...
if you are able to see these code snippets, then you can start to change
values, otherwise, you need to decompress text streams
you can perform this task with
*pdftk*
-
http://www.pdflabs.com/docs/install-pdftk/
pdftk file.pdf output uncompressed.pdf uncompress
and recompress after finished changes
pdftk uncompressed.pdf output recompressed.pdf compress
now, if you see these code snippets, you can change values
# STEP 1 (for pdf editing) -
the first thing you need is to find the right equivalence between RGB
color values of text and background and the internal pdf represerntation
of same colors
since it seems you are a windowsian inhabitant from the third planet in
the Micro$oft constellation, you can use a free color picker like this
http://www.iconico.com/download.aspx?app=ColorPic&type=free
to identify the rgb values of text and background colors
once you have these values, you need to convert into special internal pdf
representation
to do this take i mind this proportion:
1:255=x:color you selected
for instance: let say you have this RGB triplet for background: 30,144,255
-
http://i.stack.imgur.com/wMsKp.png
to know correspondent values in pdf in order to insert in code snippet to
change pdf background color, you do: (you can use http://
www.wolframalpha.com/ to compute with precision)
1:255=x:30 = 30/255 = 0.117 (approximated to first three decimals)
1:255=x:144 = 144/255 = 0.564 (approximated to first three decimals)
1:255=x:255 = 255/255 = 1
so, the whole triplet in pdf, corresponding to RGB 30,144,255, will be:
0.117 0.564 1.000
# STEP 2 (for pdf editing)
we look for 0.117 0.564 1.000 in pdf file with notepad++ (*wrap around*
and *match one word only* need to be checked) and we found the internal
pdf representation of background and we can change from azure to, let say,
white
1.000 1.000 1.000
or
1 1 1
but, since you wrote about *black background*, to be more precise, I
created a sample pdf with *black background* and *white text*
-
http://ge.tt/2jh7rTO/v/0
since we know that 0.000 0.000 0.000 rg means *black*, we look for this
and we can change from 0.000 0.000 0.000 rg, to 1.000 1.000 1.000 rg
(white) BUT...
at same time, if, I suppose, your text is white, you can also change the
text from white to black, otherwise it will be invisible, white on white
so, we cannot simply change directly black background to white, at once,
since doing this, we have not a difference between color text and
background values
and then we act as follows:
we change black background from 0.000 0.000 0.000 into something like
0.5 0.5 0.5 (light grey)
-
http://ge.tt/2jh7rTO/v/1 (resulting pdf - intermediate step)
then looking for
1.000 1.000 1.000 (white text) and change to black
0.000 0.000 0.000
finally, we change again the color of background from
0.5 0.5 0.5 (light grey)
to white: 1.000 1.000 1.000
and we have now a vector pdf with black text and white background
please, remember to
1 - compress again this pdf you mmodified if you uncompressed with pdftk
2 - repair
pdftk file.pdf output fixed.pdf
there is another way, starting from postscript, to perform the same task,
but being you a windowsian, I guess the postscript way is the harder way
for you, but if someone (a linuxian from Torvald constellation) is
interested I can explain how do the same thing in postscript
not in this post to avoid to be too verbose
give a feedback, please, and feel free to ask more
--
Puppy Linux wiki:
http://dokupuppylinux.co.cc
Puppy Linux Forum:
http://www.italianpuppy.org/
Windows me genuit, Ubuntu rapuere / tenet nunc Puppy Linux...
invito dropbox 2GB free -
http://db.tt/Vc6IeN4