You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Jeffrey Matthew <je...@gmail.com> on 2023/12/06 02:23:33 UTC

Fetch the background color for text in PDF

Hey Team,

I'm new to pdfbox and working on it right now.
I wanted to know if we have sample code to fetch the background color for a
text with pdfBox.?
The example provided in :
https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextColors.java?view=markup&pathrev=1904918

didn't work even though the mode is Fill(0).

PDFBox version: 3.0.0

Thanks,
Jeffrey

Re: Fetch the background color for text in PDF

Posted by Tilman Hausherr <TH...@t-online.de>.
There is no such a thing as "the background color". The background is 
whatever you have at the area when you're putting out the glyphs. It can 
be several colors if you're overwriting an image.

Tilman




On 06.12.2023 03:23, Jeffrey Matthew wrote:
> Hey Team,
>
> I'm new to pdfbox and working on it right now.
> I wanted to know if we have sample code to fetch the background color for a
> text with pdfBox.?
> The example provided in :
> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextColors.java?view=markup&pathrev=1904918
>
> didn't work even though the mode is Fill(0).
>
> PDFBox version: 3.0.0
>
> Thanks,
> Jeffrey
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org