https://bz.apache.org/bugzilla/show_bug.cgi?id=66145

            Bug ID: 66145
           Summary: [PATCH] Add xsd schema for drawing/2008/diagram to
                    read SmartArt diagrams
           Product: POI
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 38329
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38329&action=edit
SVN Patch - Adding .xsd schema file and updating build.gradle

When a powerpoint presentation contains SmartArt, the generated xml has the
following files generated in the `diagrams/` directory:
- data1.xml
- layout1.xml
- quickStyle1.xml
- colors1.xml
- drawing1.xml

This last `drawing1.xml` is not in the openxml spec. It was added by Microsoft
later. This drawing1.xml contains the layout of the last successful render (as
drawingml Shapes). 

> A CT_Drawing element that specifies the last successful output of diagram 
> layout. This element is the root element of the Diagram Layout part (see 
> 2.1.3).
https://docs.microsoft.com/en-us/openspecs/office_standards/ms-odrawxml/44da4385-43e1-4c9e-9061-71557d17155a

The other files inside `diagrams` are more akin to rendering instructions. For
example, the layouts file has `forEach` loops and `if` and `else` branches. I
took a look at how libreoffice handles it, and it seemed like quite a
complicated bit of code. See some of the visitor logic in this directory:
https://github.com/LibreOffice/core/tree/master/oox/source/drawingml/diagram.
There is a fantastic talk about SmartArt in LibreOffice that goes into more
details about the challenges with rendering here: https://av.tib.eu/media/44343

The drawing file contains the rendered output as drawingml shapes. Reading from
these directly should hopefully be the easiest and most straightforward way to
extract SmartArt diagrams.

I've attached a patch file that adds the xsd schema for these drawing.xml files
to enable them to be read by poi library consumers.

Following up from my message on the mailing list
https://lists.apache.org/thread/h59634vq8r1jb49j108pbwdggobwbkpo

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to