Hello Marc,

was my thought too that 13 is the font size. Just for the records that
would be something like 

/Helv 13 Tf 0 g and not /Helv Tf 13 0 g

BR
Maruan 

Am Mittwoch, dem 04.06.2025 um 09:34 -0700 schrieb Marc Kaufman:
> I would point out that the problem with this appearance setting is
> not 
> the color, but the missing Font specification.
> 
> / 13 0 g vs / Helv Tf 13 0 g. The 13 being the font size.
> 
> Marc
> 
> On 6/4/2025 1:09 AM, sahy...@fileaffairs.de wrote:
> > Your welcome. Good that you found a solution.
> > 
> > We could handle the wrong color setting in pdfbox and use defaults
> > instead of throwing but I'm not a big fan of that as different
> > users of
> > the lib might use different defaults.
> > 
> > BR
> > Maruan
> > 
> > Am Mittwoch, dem 04.06.2025 um 09:54 +0200 schrieb Ulf Dittmer:
> > > Thank you, that put me on the right track. I had no idea about
> > > the
> > > inner
> > > workings of appearances, and your explanation taught me enough
> > > about
> > > it to
> > > substitute something in case a field has a weird one - kudos!
> > > 
> > > I'm guessing the form is mostly printed out, and filled in by
> > > hand,
> > > so that
> > > this issue hasn't surfaced before.
> > > 
> > > Cheers!
> > > Ulf
> > > 
> > > On Tue, Jun 3, 2025 at 10:27 pmsahy...@fileaffairs.de <
> > > sahy...@fileaffairs.de> wrote:
> > > 
> > > > Hello Ulf,
> > > > 
> > > > a typical default appearance string looks like this
> > > > 
> > > > /Helv 12 Tf 0 g
> > > > 
> > > > There are two operators Tf, to set the font, and g to set the
> > > > color
> > > > with the arguments for the operators being supplied before.
> > > > 
> > > > Helv 12 being the arguments for Tf and
> > > > 0  being the argument for g
> > > > 
> > > > Your form has / 13 0 g
> > > > 
> > > > So 13 0 are being treated as arguments for the g operator. But
> > > > there
> > > > are no colors with 2 arguments. It's either 1 (Greyscale) , 3
> > > > (RGB)
> > > > or
> > > > 4 (CMYK) arguments.
> > > > 
> > > > So IMHO the default apperace string is wrong.
> > > > 
> > > > It's also very unusual that it doesn't set a font.
> > > > 
> > > > Workaround would be to set the default apperance string similar
> > > > to
> > > > the
> > > > first sample above.
> > > > 
> > > > BR
> > > > Maruan

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

Reply via email to