Error when exporting a salt diagram as PDF

0 votes
asked Jul 20, 2021 in Bug by anonymous
I'am using the FOP and Batik library and I can export a PDF file for this simple diagram:

@startuml
Alice -> Bob: test
@enduml

But when I've tried this Diagram:

@startuml

    (*) --> "
    {{
        salt
        {+
            <b>Login
            ..
            Login    | "MyName   "
            Password | "****     "
            [Cancel] | [  OK   ]
        }

    }}
    " as login

@enduml

I've got the following error:

org.apache.batik.transcoder.TranscoderException: null

Enclosed Exception:

file:/C:/Users/user/AppData/Local/Temp/pdf400035918649404065.svf:-1

The attribute "width" of the element <rect> is required

at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:228)

at org.apache.fop.svg.PDFTranscoder.transcode(PDFTranscoder.java:140)

at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)

at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:158)

at org.apache.batik.apps.rasterizer.SVGConverter.transcode(SVGConverter.java:1008)

at org.apache.batik.apps.rasterizer.SVGConverter.execute(SVGConverter.java:719)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:73)

at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:288)

at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:140)

at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:157)

at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(PSystemUtils.java:233)

at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)

at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:171)

at PlantUML.Test.testPlantUML(Test.java:75)

at PlantUML.Main.main(Main.java:76)

Caused by: org.apache.batik.bridge.BridgeException: file:/C:/Users/user/AppData/Local/Temp/pdf400035918649404065.svf:-1

The attribute "width" of the element <rect> is required

at org.apache.batik.bridge.SVGRectElementBridge.buildShape(SVGRectElementBridge.java:119)

at org.apache.batik.bridge.SVGShapeElementBridge.createGraphicsNode(SVGShapeElementBridge.java:60)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)

at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:210)

... 18 more

After looking into the SVG file before it is converted to the PDF file, I've found that in one of the "rect" elements the width and height was put into a style parameter as one string:

<rect fill="#FFFFFF" style="width:195px;height:101px;background:#FFFFFF;" />

After splitting the string into single parameters the SVG could be converted into a PDF file:

<rect fill="#FFFFFF" swidth="195px" height="101px" background="#FFFFFF" />
commented Jul 24, 2021 by Peter
Seeing the same error in my implementation

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...