1

I would like to scan a PDF using Apache PDFBox 2.x for elements with white background color and change these elements to have transparent background or to remove the elements' background settings at all.

The reason for this is to make the PDF overlayable over another PDF (using PDFBox merger utility). Within this process, regions with elements with explicit white background of the overlaying pdf should not wipe out the contents of the other (overlayed) pdf.

White background cannot be seen when printing a pdf on a white sheet of paper, so in many cases it does not make sense to use explicit white background at all. Regions with backgrounds in other colors, however, should remain their background color.

I've found this article about font colors in PDF's, but it deals only with stroke colors, not with background filling colors.

https://stackoverflow.com/a/38392128/5295284

Many thanx in advance!

Tombo

tombo_189
  • 384
  • 5
  • 22
  • 1
    There is nothing like a specific text background colour in PDF, text always is drawn with a transparent background. Sometimes, though, you find PDFs in which first a white rectangle is drawn in the area in which afterwards text is drawn. Thus, you might want to look for vector graphics, white rectangles in particular. – mkl Jul 29 '17 at 08:25
  • 1
    no that's not true, you can make a text paragraph in, say word, give it a red (or white) background and convert that to a pdf. Then you've got a pdf with an element with colored background. – tombo_189 Jul 29 '17 at 10:46
  • Why do you say it is not true and then talk about text background in word? I talked about pdf, and the pdf generated from that word document is as I explained, a rectangle painted first, then some text drawn upon it. – mkl Jul 29 '17 at 11:04

0 Answers0