xwikisas / application-diagram

Create various types of diagrams using draw.io
GNU Lesser General Public License v2.1
0 stars 8 forks source link

Background images not exported as PDF #89

Closed ane-gabriela closed 4 years ago

ane-gabriela commented 4 years ago

Steps to reproduce:

  1. Create a new diagram
  2. Select a background image
  3. Add some shapes, text
  4. Click Save or Save & View
  5. Click on File > Export as > PDF... > Export
  6. Select Open in a New Window or Download

Expected results: The diagram appears with the selected background image and shapes.

Actual results: The background image is missing.

Environment: Windows 10, XWiki 11.3.6 Standard and Chrome 78, Diagram Application (Pro) 1.11

BackgroundImage

PDFExport

mflorea commented 4 years ago

For this we would need to extend the diagram-graph-xml-filter module from Diagram.DiagramSheet to add support for filtering the backgroundImage attribute of mxGraphModel. This issue is more how to do it without duplicating code.

<mxGraphModel dx="714" dy="497" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" background="none" backgroundImage="{&quot;src&quot;:&quot;https://eztrackit.com/wp-content/uploads/2013/07/Tree.png&quot;,&quot;width&quot;:&quot;256&quot;,&quot;height&quot;:&quot;256&quot;}" math="0" shadow="0">

The value of backgroundImage seems to be JSON.

mflorea commented 4 years ago

I'm removing the critical label because setting a background image on a diagram is not a common use case IMO.