Roderick McMullen created BATIK-1384:
----------------------------------------

             Summary: SVGDescriptor returned with overridden 
DefaultExtensionHandler.handleComposite() is ignored the first time after 
creation
                 Key: BATIK-1384
                 URL: https://issues.apache.org/jira/browse/BATIK-1384
             Project: Batik
          Issue Type: Bug
          Components: SVGGraphics2D
    Affects Versions: 1.19
            Reporter: Roderick McMullen
         Attachments: batik-blendmode-issue.zip

To convert PDF pages with blend mode ({{/BM}}) composites to SVG, we provide an 
override to {{DefaultExtensionHandler.handleComposite}} that returns an 
{{SVGCompositeDescriptor}} with overridden 
{{SVGCompositeDescriptor.getAttributeMap}} that adds {{mix-blend-mode}}.

However, {{SVGCustomComposite.toSVG}} returns null rather than our object from 
[SVGCustomComposite.java#L83|https://github.com/apache/xmlgraphics-batik/blob/55478175f63517cfb5ce9b16afe2591fd7caab96/batik-svggen/src/main/java/org/apache/batik/svggen/SVGCustomComposite.java#L83].
 Unless the {{Composite}} is encountered again and the cached 
{{SVGCompositeDescriptor}} is retrieved for use, 
[SVGGraphicContextConverter.java#L103|https://github.com/apache/xmlgraphics-batik/blob/55478175f63517cfb5ce9b16afe2591fd7caab96/batik-svggen/src/main/java/org/apache/batik/svggen/SVGGraphicContextConverter.java#L103]
 is not reached and overridden {{SVGCompositeDescriptor.getAttributeMap}} is 
unused.

*Steps to reproduce*

 # Unzip attached project [^batik-blendmode-issue.zip] and open folder with 
VSCode. 
 # Compile the project.
 # Run and Debug launch config 'blendmode-pdflib-apryse.pdf-page1' to create 
'target/blendmode-pdflib-apryse.pdf-page1.svg'.
 # Done.

*Expected*

3. Occurrences of CSS attribute {{mix-blend-mode}} are found in output SVG. 
e.g. {{mix-blend-mode:multiply}}

*Actual*

3. No occurrences of {{mix-blend-mode}} found in output SVG.

attached project [^batik-blendmode-issue.zip]
{noformat}
batik-blendmode-issue.zip!\blendmode-pdflib-apryse.pdf
batik-blendmode-issue.zip!\blendmode-pdflib-apryse.pdf-page1-actual.svg
batik-blendmode-issue.zip!\blendmode-pdflib-apryse.pdf-page1-expected.svg
batik-blendmode-issue.zip!\pom.xml
batik-blendmode-issue.zip!\.vscode\launch.json
batik-blendmode-issue.zip!\src\main\java\com\snowbound\pdf\batik\RmjCompositeDescriptor.java
batik-blendmode-issue.zip!\src\main\java\com\snowbound\pdf\batik\RmjConstants.java
batik-blendmode-issue.zip!\src\main\java\com\snowbound\pdf\batik\RmjExtensionHandler.java
batik-blendmode-issue.zip!\src\main\java\com\snowbound\sample\pdf\SingleConversion.java
batik-blendmode-issue.zip1\target\blendmode-pdflib-apryse.pdf-page1.png
batik-blendmode-issue.zip1\target\blendmode-pdflib-apryse.pdf-page1.svg
{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to