Failure to export a Confluence document with Plantuml-generated SVGs

0 votes
asked Aug 9, 2016 in Bug by boshka (4,060 points)
edited Aug 10, 2016 by boshka

1. when you try to export a Confluence document that renders the svgs via SVG OUT plugin to PDF, the document gets generated, however inside the generated document there will be no SVG, instead you will see an error:

org.apache.batik.transcoder.TranscoderException: null Enclosed Exception: null:-1 The attribute "in2" of the element is required

2. If you replace the plantuml-generated svgs with a third party svg sources the export succeeds

3. Plantuml generated SVGs do not validate with https://validator.w3.org/ with an error, mentioned abive:

required attribute "in2" not specified

 

If you manually add the in2 attribute to the Plantuml generated svg source - exporting will succeed!

 

Versions:

- Atlassian Confluence 5.6.3

- SVG OUT Macro v2.3.2

- PlantUml used for SVG generation is v8046

commented Aug 18, 2016 by boshka (4,060 points)
Hi, could you please confirm if there is any progress on this issue?
commented Aug 20, 2016 by plantuml (298,440 points)
Sorry for the delay.
Could you show us where you have manually added the in2 attribute, with some basic example. This would help to solve the issue.
Thanks!
commented Aug 22, 2016 by boshka (4,060 points)
edited Aug 22, 2016 by boshka
Here is an example. I think that the "in2" validation error is introduced by the calls of the tsLabel fuction.

@startuml does_not_validate.svg


!define labelTpl [[anchor{JUMP_TO} ts_id]] <color:backColor><size:14><&arrow-thick-bottom></size></color><back:backColor><color:white>&#160;&#160;backColor&#160;&#160;</color></back>
!define labelTemplate \n labelTpl
!define tsLabel(backColor,anchor,ts_id) labelTemplate

    start
-[#red;#blue]->   
    partition "SOME FLOW" {
            if(Condition?)then(yes:tsLabel(red,anchor1,id1))
-[#red]->           
            else(no:tsLabel(blue,anchor2,id2))
-[#blue]->
            endif
-[#red;#blue]->
    }

    stop
   
@enduml


Here is the generated svg if you need it:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="212px" style="width:233px;height:212px;" version="1.1" viewBox="0 0 233 212" width="233px"><defs><filter height="300%" id="fsfl8tu" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter><filter height="1" id="b5gil8u0" width="1" x="0" y="0"><feFlood flood-color="#FF0000"/><feComposite in="SourceGraphic"/></filter><filter height="1" id="b5gil8u1" width="1" x="0" y="0"><feFlood flood-color="#0000FF"/><feComposite in="SourceGraphic"/></filter></defs><g><ellipse cx="116.3333" cy="20" fill="#000000" filter="url(#fsfl8tu)" rx="10" ry="10" style="stroke: none; stroke-width: 1.0;"/><rect fill="#FFFFFF" filter="url(#fsfl8tu)" height="125.2813" style="stroke: #000000; stroke-width: 2.0;" width="216.6667" x="10" y="40.5762"/><path d="M105,41.5762 L105,51.1855 L95,61.1855 L10,61.1855 " fill="#FFFFFF" style="stroke: #000000; stroke-width: 2.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="85" x="13" y="56.1094">SOME FLOW</text><polygon fill="#FEFECE" filter="url(#fsfl8tu)" points="91.3333,81.8574,141.3333,81.8574,153.3333,93.8574,141.3333,105.8574,91.3333,105.8574,79.3333,93.8574,91.3333,81.8574" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="50" x="91.3333" y="98.3584">Condition?</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="21" x="20" y="77.6045">yes:</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="23" y="91.4404"/><a target="_top" xlink:href="anchor1" xlink:title="JUMP_TO"><text fill="#0000FF" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="14" x="23" y="91.4404">id1</text><line style="stroke: #0000FF; stroke-width: 1.0;" x1="23" x2="37" y1="93.4404" y2="93.4404"/></a><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="40" y="91.4404"/><path d="M44.5,81.0241 L44.5,86.8574 L42.1667,86.8574 L45.7028,90.3574 L49.1667,86.8574 L46.8333,86.8574 L46.8333,81.0241 L44.5,81.0241 " fill="#FF0000" style="stroke: ; stroke-width: 0.0; stroke-dasharray: ;"/><text fill="#FFFFFF" filter="url(#b5gil8u0)" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="28" x="51.3333" y="91.4404">  red  </text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="15" x="153.3333" y="77.6045">no:</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="156.3333" y="91.4404"/><a target="_top" xlink:href="anchor2" xlink:title="JUMP_TO"><text fill="#0000FF" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="14" x="156.3333" y="91.4404">id2</text><line style="stroke: #0000FF; stroke-width: 1.0;" x1="156.3333" x2="170.3333" y1="93.4404" y2="93.4404"/></a><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="173.3333" y="91.4404"/><path d="M177.8333,81.0241 L177.8333,86.8574 L175.5,86.8574 L179.0362,90.3574 L182.5,86.8574 L180.1667,86.8574 L180.1667,81.0241 L177.8333,81.0241 " fill="#0000FF" style="stroke: ; stroke-width: 0.0; stroke-dasharray: ;"/><text fill="#FFFFFF" filter="url(#b5gil8u1)" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="32" x="184.6667" y="91.4404">  blue  </text><polygon fill="#FEFECE" filter="url(#fsfl8tu)" points="116.3333,121.8574,128.3333,133.8574,116.3333,145.8574,104.3333,133.8574,116.3333,121.8574" style="stroke: #A80036; stroke-width: 1.5;"/><ellipse cx="116.3333" cy="195.8574" fill="none" filter="url(#fsfl8tu)" rx="10" ry="10" style="stroke: #000000; stroke-width: 1.0;"/><ellipse cx="116.8333" cy="196.3574" fill="#000000" filter="url(#fsfl8tu)" rx="6" ry="6" style="stroke: none; stroke-width: 1.0;"/><line style="stroke: #FF0000; stroke-width: 1.5;" x1="79.3333" x2="69.3333" y1="93.8574" y2="93.8574"/><polygon fill="#FF0000" points="65.3333,103.8574,69.3333,113.8574,73.3333,103.8574,69.3333,107.8574" style="stroke: #FF0000; stroke-width: 1.5;"/><line style="stroke: #FF0000; stroke-width: 1.5;" x1="69.3333" x2="69.3333" y1="93.8574" y2="133.8574"/><line style="stroke: #FF0000; stroke-width: 1.5;" x1="69.3333" x2="104.3333" y1="133.8574" y2="133.8574"/><polygon fill="#FF0000" points="94.3333,129.8574,104.3333,133.8574,94.3333,137.8574,98.3333,133.8574" style="stroke: #FF0000; stroke-width: 1.0;"/><line style="stroke: #0000FF; stroke-width: 1.5;" x1="153.3333" x2="163.3333" y1="93.8574" y2="93.8574"/><polygon fill="#0000FF" points="159.3333,103.8574,163.3333,113.8574,167.3333,103.8574,163.3333,107.8574" style="stroke: #0000FF; stroke-width: 1.5;"/><line style="stroke: #0000FF; stroke-width: 1.5;" x1="163.3333" x2="163.3333" y1="93.8574" y2="133.8574"/><line style="stroke: #0000FF; stroke-width: 1.5;" x1="163.3333" x2="128.3333" y1="133.8574" y2="133.8574"/><polygon fill="#0000FF" points="138.3333,129.8574,128.3333,133.8574,138.3333,137.8574,134.3333,133.8574" style="stroke: #0000FF; stroke-width: 1.0;"/><line style="stroke: #FF0000; stroke-width: 3.0;" x1="115.3333" x2="115.3333" y1="30" y2="81.8574"/><polygon fill="#FF0000" points="111.3333,71.8574,115.3333,81.8574,119.3333,71.8574,115.3333,75.8574" style="stroke: #FF0000; stroke-width: 1.0;"/><line style="stroke: #0000FF; stroke-width: 2.0;" x1="117.3333" x2="117.3333" y1="30" y2="81.8574"/><polygon fill="#0000FF" points="113.3333,71.8574,117.3333,81.8574,121.3333,71.8574,117.3333,75.8574" style="stroke: #0000FF; stroke-width: 1.0;"/><line style="stroke: #FF0000; stroke-width: 3.0;" x1="115.3333" x2="115.3333" y1="145.8574" y2="185.8574"/><polygon fill="#FF0000" points="111.3333,175.8574,115.3333,185.8574,119.3333,175.8574,115.3333,179.8574" style="stroke: #FF0000; stroke-width: 1.0;"/><line style="stroke: #0000FF; stroke-width: 2.0;" x1="117.3333" x2="117.3333" y1="145.8574" y2="185.8574"/><polygon fill="#0000FF" points="113.3333,175.8574,117.3333,185.8574,121.3333,175.8574,117.3333,179.8574" style="stroke: #0000FF; stroke-width: 1.0;"/></g></svg>
commented Aug 22, 2016 by plantuml (298,440 points)
Ok, thanks.
Could you also post the _manually_ edited SVG with the "in2" attribute ?
Thanks!
commented Aug 22, 2016 by boshka (4,060 points)
This one fixes the "in2" issue (manually added):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="212px" style="width:233px;height:212px;" version="1.1" viewBox="0 0 233 212" width="233px"><defs><filter height="300%" id="fsfl8tu" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter><filter height="1" id="b5gil8u0" width="1" x="0" y="0"><feFlood flood-color="#FF0000"/><feComposite in="SourceGraphic" in2="SourceGraphic"/></filter><filter height="1" id="b5gil8u1" width="1" x="0" y="0"><feFlood flood-color="#0000FF"/><feComposite in="SourceGraphic" in2="SourceGraphic"/></filter></defs><g><ellipse cx="116.3333" cy="20" fill="#000000" filter="url(#fsfl8tu)" rx="10" ry="10" style="stroke: none; stroke-width: 1.0;"/><rect fill="#FFFFFF" filter="url(#fsfl8tu)" height="125.2813" style="stroke: #000000; stroke-width: 2.0;" width="216.6667" x="10" y="40.5762"/><path d="M105,41.5762 L105,51.1855 L95,61.1855 L10,61.1855 " fill="#FFFFFF" style="stroke: #000000; stroke-width: 2.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="85" x="13" y="56.1094">SOME FLOW</text><polygon fill="#FEFECE" filter="url(#fsfl8tu)" points="91.3333,81.8574,141.3333,81.8574,153.3333,93.8574,141.3333,105.8574,91.3333,105.8574,79.3333,93.8574,91.3333,81.8574" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="50" x="91.3333" y="98.3584">Condition?</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="21" x="20" y="77.6045">yes:</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="23" y="91.4404"/><a target="_top" xlink:href="anchor1" xlink:title="JUMP_TO"><text fill="#0000FF" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="14" x="23" y="91.4404">id1</text><line style="stroke: #0000FF; stroke-width: 1.0;" x1="23" x2="37" y1="93.4404" y2="93.4404"/></a><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="40" y="91.4404"/><path d="M44.5,81.0241 L44.5,86.8574 L42.1667,86.8574 L45.7028,90.3574 L49.1667,86.8574 L46.8333,86.8574 L46.8333,81.0241 L44.5,81.0241 " fill="#FF0000" style="stroke: ; stroke-width: 0.0; stroke-dasharray: ;"/><text fill="#FFFFFF" filter="url(#b5gil8u0)" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="28" x="51.3333" y="91.4404">  red  </text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="15" x="153.3333" y="77.6045">no:</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="156.3333" y="91.4404"/><a target="_top" xlink:href="anchor2" xlink:title="JUMP_TO"><text fill="#0000FF" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" text-decoration="underline" textLength="14" x="156.3333" y="91.4404">id2</text><line style="stroke: #0000FF; stroke-width: 1.0;" x1="156.3333" x2="170.3333" y1="93.4404" y2="93.4404"/></a><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="173.3333" y="91.4404"/><path d="M177.8333,81.0241 L177.8333,86.8574 L175.5,86.8574 L179.0362,90.3574 L182.5,86.8574 L180.1667,86.8574 L180.1667,81.0241 L177.8333,81.0241 " fill="#0000FF" style="stroke: ; stroke-width: 0.0; stroke-dasharray: ;"/><text fill="#FFFFFF" filter="url(#b5gil8u1)" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="32" x="184.6667" y="91.4404">  blue  </text><polygon fill="#FEFECE" filter="url(#fsfl8tu)" points="116.3333,121.8574,128.3333,133.8574,116.3333,145.8574,104.3333,133.8574,116.3333,121.8574" style="stroke: #A80036; stroke-width: 1.5;"/><ellipse cx="116.3333" cy="195.8574" fill="none" filter="url(#fsfl8tu)" rx="10" ry="10" style="stroke: #000000; stroke-width: 1.0;"/><ellipse cx="116.8333" cy="196.3574" fill="#000000" filter="url(#fsfl8tu)" rx="6" ry="6" style="stroke: none; stroke-width: 1.0;"/><line style="stroke: #FF0000; stroke-width: 1.5;" x1="79.3333" x2="69.3333" y1="93.8574" y2="93.8574"/><polygon fill="#FF0000" points="65.3333,103.8574,69.3333,113.8574,73.3333,103.8574,69.3333,107.8574" style="stroke: #FF0000; stroke-width: 1.5;"/><line style="stroke: #FF0000; stroke-width: 1.5;" x1="69.3333" x2="69.3333" y1="93.8574" y2="133.8574"/><line style="stroke: #FF0000; stroke-width: 1.5;" x1="69.3333" x2="104.3333" y1="133.8574" y2="133.8574"/><polygon fill="#FF0000" points="94.3333,129.8574,104.3333,133.8574,94.3333,137.8574,98.3333,133.8574" style="stroke: #FF0000; stroke-width: 1.0;"/><line style="stroke: #0000FF; stroke-width: 1.5;" x1="153.3333" x2="163.3333" y1="93.8574" y2="93.8574"/><polygon fill="#0000FF" points="159.3333,103.8574,163.3333,113.8574,167.3333,103.8574,163.3333,107.8574" style="stroke: #0000FF; stroke-width: 1.5;"/><line style="stroke: #0000FF; stroke-width: 1.5;" x1="163.3333" x2="163.3333" y1="93.8574" y2="133.8574"/><line style="stroke: #0000FF; stroke-width: 1.5;" x1="163.3333" x2="128.3333" y1="133.8574" y2="133.8574"/><polygon fill="#0000FF" points="138.3333,129.8574,128.3333,133.8574,138.3333,137.8574,134.3333,133.8574" style="stroke: #0000FF; stroke-width: 1.0;"/><line style="stroke: #FF0000; stroke-width: 3.0;" x1="115.3333" x2="115.3333" y1="30" y2="81.8574"/><polygon fill="#FF0000" points="111.3333,71.8574,115.3333,81.8574,119.3333,71.8574,115.3333,75.8574" style="stroke: #FF0000; stroke-width: 1.0;"/><line style="stroke: #0000FF; stroke-width: 2.0;" x1="117.3333" x2="117.3333" y1="30" y2="81.8574"/><polygon fill="#0000FF" points="113.3333,71.8574,117.3333,81.8574,121.3333,71.8574,117.3333,75.8574" style="stroke: #0000FF; stroke-width: 1.0;"/><line style="stroke: #FF0000; stroke-width: 3.0;" x1="115.3333" x2="115.3333" y1="145.8574" y2="185.8574"/><polygon fill="#FF0000" points="111.3333,175.8574,115.3333,185.8574,119.3333,175.8574,115.3333,179.8574" style="stroke: #FF0000; stroke-width: 1.0;"/><line style="stroke: #0000FF; stroke-width: 2.0;" x1="117.3333" x2="117.3333" y1="145.8574" y2="185.8574"/><polygon fill="#0000FF" points="113.3333,175.8574,117.3333,185.8574,121.3333,175.8574,117.3333,179.8574" style="stroke: #0000FF; stroke-width: 1.0;"/></g></svg>
commented Aug 22, 2016 by plantuml (298,440 points)
Thanks! This really helps!
Here is a beta that fixes this issue
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Regards,
commented Aug 22, 2016 by boshka (4,060 points)
edited Aug 22, 2016 by boshka
Thanks, however:

1. in my example the back part stopped working. There is no no background color really now, just white font color:

<back:backColor><color:white>&#160;&#160;backColor&#160;&#160;</color></back>


2. The in2 errors now gone, however i see now 21 other validation errors in the above example. Also the whole document export to pdf still fails.

1 Answer

0 votes
answered Aug 22, 2016 by plantuml (298,440 points)
Maybe the right correction is:

<feComposite in="SourceGraphic" in2=""/>

Please try this new beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Thanks!
commented Aug 23, 2016 by plantuml (298,440 points)
Great, many thanks for your help.
The last beta should be ok
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
Note that if you still have issues with PDF, you may try to disable shadowing:

skinparam shadowing false
commented Aug 23, 2016 by boshka (4,060 points)
edited Aug 23, 2016 by boshka
I already have it disabled. And it still fails. Probably there is something else now that we are done with the validation.

Please let me know when the fixed version is released.
And many thanks!
commented Aug 23, 2016 by plantuml (298,440 points)
Are you still using the same example ?

This one is working for us:
https://dl.dropboxusercontent.com/u/13064071/test1.pdf
commented Aug 23, 2016 by boshka (4,060 points)
no, my document is really big - there are 39 diagramms.
It now fails with the following (after a couple of minutes):

An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.
commented Aug 24, 2016 by boshka (4,060 points)
Ok, good news! we managed to get the exported pdf document generated , by significantly increasing the nginx timeout for backend...
...