问题
Is there a way to change the background color of a scanned PDF file? My PDF show a few black lines, and I am trying to remove them.
回答1:
You could probably easily change it with a PDF Editor. There are a few open source ones out there, check out this page http://www.cogniview.com/convert-pdf-to-excel/post/pdf-editing-creation-50-open-sourcefree-alternatives-to-adobe-acrobat/
回答2:
vector background color (different from scanned image background color that is raster) in pdf is determined by this snippet of code inside a pdf, placed between
stream
and
endstream
tags
/GS1 gs
1.000 1.000 1.000 rg
0.00 841.00 m
595.25 841.00 l
595.25 -0.85 l
0.00 -0.85 l
0.00 841.00 l
h
f
in context inside a pdf:
stream
/GS1 gs
1.000 1.000 1.000 rg
0.00 841.00 m
595.25 841.00 l
595.25 -0.85 l
0.00 -0.85 l
0.00 841.00 l
h
f
endstream
1.000 1.000 1.000 means = white
1.000 0.000 0.000 means = red
1.000 0.749 0.792 means pink and so on...
see these three pdf: (red, pink and white)
http://ge.tt/9ZavuZI
you can obtain these values directly from sodipodi color selector or, if you have a graphic software that indicates RGB color values from 0 to 255 you simply apply the proportion
1:255=x:color you selected
for instance: let say you have this RGB triplet: 30,144,255
to know correspondent values in order to insert in code snippet to change pdf background color, you do:
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 you insert, in pdf source code, between stream and endstream tags:
stream
/GS1 gs
0.117 0.564 1.000 rg
0.00 841.00 m
595.25 841.00 l
595.25 -0.85 l
0.00 -0.85 l
0.00 841.00 l
h
f
endstream
回答3:
The problem is that on scanned documents, you cannot use the things shown in the previous answers. Try pdftocolor, a PDF color conversion tool 100%free:
http://www.pdftocolor.com
来源:https://stackoverflow.com/questions/10856521/change-background-color-of-pdf