for me it is strange that the expansion is only in the vertical axis (and not
in the horizontal axis).
A PDF axial gradient defines a band with gradually changing colors
across the band. If your shading does not extrapolate outside its band,
nothing is drawn at either side of the band. The band is not constrained
in the direction along its direction. So you must use clipping if you
want to constrain it in that direction.
It is common practice to use a shading color derived from the shading.
If you do so, the fill operator takes care of everything.
--
Mark de Does, Magdalenastraat 6, 3512 NH Utrecht, the Netherlands,
e: m...@mdedoes.xs4all.nl
On 04-07-2025 16:37, Esteban R wrote:
Thanks for your answer. I confirm: if I replace "W f" by "W n" in the original
document then the rendering is OK.
Anyway, for me it is strange that the expansion is only in the vertical axis
(and not in the horizontal axis).
I can create a bug report if you want. For my use case I can solve the issue
with a workaround.
________________________________
De: Tilman Hausherr <thaush...@t-online.de>
Enviado: viernes, 4 de julio de 2025 13:36
Para: users@pdfbox.apache.org <users@pdfbox.apache.org>
Asunto: Re: Rendering issue with type 2 shading: vertical expansion
Hi,
It is related to having "W f" instead of "W n" (it works the expected
way when having "W n"). I think we're not fully correct when handling
the "n" operator, that one does the handling of the clipping path which
(maybe) should have been done earlier when handling the "W" operator.
(Usually "W n" come together) My understanding of the "n" description is
that it should consume the path.
Tilman
On 7/4/2025 3:08 PM, Esteban R wrote:
Hello. For the following pdf (which is a simplification of a real life example)
the shading is expanded vertically all the page. Other viewers show a rectangle.
https://drive.google.com/file/d/1bocFsJbOFAlRijKnBUfSBdQ_GVX3oSUQ/view?usp=drive_link
Is it an issue from pdfbox or maybe it is a problem with the document itself?
Content stream:
q
0.5 0.5 0.5 rg
396 615 171 28 re
W
f
/SHQZavYQee sh
Q
Esteban Ruiz
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org