[
https://issues.apache.org/jira/browse/PDFBOX-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14031675#comment-14031675
]
John Hewson edited comment on PDFBOX-2104 at 6/14/14 7:46 PM:
--------------------------------------------------------------
Some more thoughts:
- storing a Raster in PDGraphicsState seems like overkill, can the PDSoftMask
be stored instead?
- PDGraphicsState#applySoftMaskToPaint() would be better placed in PageDrawer.
- PDExtendedGraphicsState shouldn't need to import PageDrawer or
PDFStreamEngine, getSoftMaskRaster() should be moved to somewhere else, perhaps
inside the PageDrawer class? We don't want copyIntoGraphicsState to take a
PDFStreamEngine context parameter, however this will be solved already if the
soft mask Raster is not part of the graphics state.
- we don't want drawing code in PDFormXObject, so createPageDrawerGroup needs
to be moved somewhere else, perhaps into PageDrawer or Invoke (that method
looks very similar to Invoke#process(), could they share code?)
- In PageDrawer the following graphics state is constructed, but it is never
used:
{code}
PDGraphicsState gs = getGraphicsState();
gs.setBlendMode(BlendComposite.NORMAL);
gs.setAlphaConstants(1.0);
gs.setNonStrokeAlphaConstants(1.0);
gs.setSoftMaskRaster(null);
{code}
was (Author: jahewson):
Some more thoughts:
- storing a Raster in PDGraphicsState seems like overkill, can the PDSoftMask
be stored instead?
- PDGraphicsState#applySoftMaskToPaint() would be better placed in PageDrawer.
- PDExtendedGraphicsState shouldn't need to import PageDrawer or
PDFStreamEngine, getSoftMaskRaster() should be moved to somewhere else, perhaps
inside the PageDrawer class? We don't want copyIntoGraphicsState to take a
PDFStreamEngine context parameter, however this will be solved already if the
sot mask Raster is not part of the graphics state.
- we don't want drawing code in PDFormXObject, so createPageDrawerGroup needs
to be moved somewhere else, perhaps into PageDrawer or Invoke (that method
looks very similar to Invoke#process(), could they share code?)
- In PageDrawer the following graphics state is constructed, but it is never
used:
{code}
PDGraphicsState gs = getGraphicsState();
gs.setBlendMode(BlendComposite.NORMAL);
gs.setAlphaConstants(1.0);
gs.setNonStrokeAlphaConstants(1.0);
gs.setSoftMaskRaster(null);
{code}
> Implement transparency groups
> -----------------------------
>
> Key: PDFBOX-2104
> URL: https://issues.apache.org/jira/browse/PDFBOX-2104
> Project: PDFBox
> Issue Type: Improvement
> Components: Rendering
> Affects Versions: 2.0.0
> Reporter: Petr Slaby
> Assignee: John Hewson
> Attachments: 000001_MTEXT_CS6.pdf, TransparencyGroups.1.patch,
> TransparencyGroups.2.patch, TransparencyGroups.patch
>
>
> The attached PDF uses transparency groups, blending and soft masks to create
> the rounded corners and shades behind images. It appears that these features
> are not implemented in PDFBox. An implementation proposal is attached in the
> TransparencyGroup.patch. The basic idea is to create a buffered image, draw
> the transparency group content onto it and then use the result to produce the
> soft mask or draw the image on the original g2d.
> Note: I am not the (only) author of the proposed change. It was developed in
> our company few years ago in sources based on a 1.7.x version of PDFBox,
> mostly by a guy who already left. Over the years, merging of the work done in
> PDFBox main stream into our source base has become impossible due to many
> refactorings and other deep going changes done. Now we would like to go the
> opposite way - where possible - bring the changes and fixes we have done into
> PDFBox main stream and start to use it in our installations.
--
This message was sent by Atlassian JIRA
(v6.2#6252)