[
https://issues.apache.org/jira/browse/PDFBOX-5443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17542102#comment-17542102
]
Tilman Hausherr commented on PDFBOX-5443:
-----------------------------------------
There is some intersection with the clipping path done in the beginning of the
TransparencyGroup class.
Here's the call for x115:
{code:java}
q
57.27 795.827 3214.32 -761.281 re
W
n
q
1 0 0 1 -3.5416E-14 -0.110229 cm
/a0 gs
/x115 Do
Q
Q
{code}
The BBox is 0 0 3827 842. So I don't see what more we can do (which would be
very difficult anyway).
Surprisingly, PDF.js is much faster than we are.
I thought about a change in
{{org.apache.pdfbox.contentstream.operator.graphics.DrawObject}} but tests show
that it doesn't always work. A possible reason could be that having a
transparency group object with no blending and no content would mean at least a
white rectangle image is copied, an ordinary form XObject would change nothing.
{code:java}
if (xobject instanceof PDTransparencyGroup && gs != null &&
(gs.getBlendMode() != BlendMode.NORMAL || gs.getAlphaConstant()
!= 1 || gs.getNonStrokeAlphaConstant() != 1 || gs.getSoftMask() != null))
{
context.showTransparencyGroup((PDTransparencyGroup) xobject);
}
else
{
context.showForm((PDFormXObject) xobject);
}
{code}
> Clipping issues in TransparencyGroup
> ------------------------------------
>
> Key: PDFBOX-5443
> URL: https://issues.apache.org/jira/browse/PDFBOX-5443
> Project: PDFBox
> Issue Type: Bug
> Reporter: Oliver Schmidtmer
> Priority: Major
> Attachments: VarianteB - Demo.pdf, test-output-1.patch
>
>
> The attached PDFs renders slow due to clipping issues when rendering
> TransparencyGroups.
> There are many TransparencyGroups, which only draw on a small area defined in
> a path.
> Unfortunately, for some, even mostly identical TransparencyGroups, the
> clipping area is calculated to span the whole image. I've added a patchfile
> for some test output:
> {code:java}
> path bounds: java.awt.Rectangle[x=3185,y=22,width=34,height=71]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=-1,width=34,height=60]
> path bounds: java.awt.Rectangle[x=3082,y=45,width=105,height=48]
> drawing 127ms clip bounds: java.awt.Rectangle[x=0,y=0,width=3215,height=762]
> path bounds: java.awt.Rectangle[x=3082,y=-25,width=34,height=71]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=0,width=34,height=12]
> path bounds: java.awt.Rectangle[x=3185,y=92,width=155,height=71]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=0,width=87,height=71]
> path bounds: java.awt.Rectangle[x=3185,y=22,width=34,height=71]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=0,width=34,height=59]
> path bounds: java.awt.Rectangle[x=2155,y=793,width=29,height=11]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=0,width=29,height=3]
> path bounds: java.awt.Rectangle[x=2146,y=793,width=10,height=20]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=0,width=10,height=3]
> path bounds: java.awt.Rectangle[x=1809,y=659,width=3,height=7]
> path bounds: java.awt.Rectangle[x=1777,y=644,width=33,height=22]
> path bounds: java.awt.Rectangle[x=1686,y=602,width=93,height=43]
> path bounds: java.awt.Rectangle[x=1665,y=593,width=22,height=11]
> path bounds: java.awt.Rectangle[x=1665,y=580,width=7,height=14]
> path bounds: java.awt.Rectangle[x=1671,y=580,width=22,height=11]
> path bounds: java.awt.Rectangle[x=1692,y=589,width=33,height=16]
> path bounds: java.awt.Rectangle[x=1723,y=604,width=38,height=12]
> path bounds: java.awt.Rectangle[x=1757,y=614,width=4,height=7]
> path bounds: java.awt.Rectangle[x=1757,y=619,width=261,height=120]
> path bounds: java.awt.Rectangle[x=2017,y=737,width=86,height=40]
> path bounds: java.awt.Rectangle[x=2101,y=775,width=55,height=19]
> drawing 126ms clip bounds: java.awt.Rectangle[x=0,y=0,width=3215,height=762]
> path bounds: java.awt.Rectangle[x=2146,y=793,width=10,height=20]
> drawing 0ms clip bounds: java.awt.Rectangle[x=0,y=0,width=10,height=3]
> path bounds: java.awt.Rectangle[x=1811,y=659,width=336,height=154]
> drawing 3ms clip bounds: java.awt.Rectangle[x=0,y=0,width=336,height=137]
> path bounds: java.awt.Rectangle[x=388,y=356,width=893,height=2]
> path bounds: java.awt.Rectangle[x=1280,y=356,width=62,height=29]
> path bounds: java.awt.Rectangle[x=1326,y=383,width=16,height=3]
> path bounds: java.awt.Rectangle[x=1306,y=384,width=21,height=7]
> path bounds: java.awt.Rectangle[x=1135,y=389,width=172,height=12]
> path bounds: java.awt.Rectangle[x=1030,y=390,width=106,height=11]
> drawing 128ms clip bounds:
> java.awt.Rectangle[x=0,y=0,width=3215,height=762]{code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]