Information Classification: External Restricted.
See https://www.chili-publish.com/security

ShapeFrame XML and Paths XML

XML Structure

Any item within a frames list of type "shape", corresponding to a Document Object Model - ShapeFrame object:

<document> <pages> <item> <frames> <item type="shape" x="10mm" y="10mm" width="80mm" height="40mm" > <paths> <item name="" id="6172D8D8-BE56-2D15-0D16-FF08CB84143F" closed="true"> <points> <item id="90696856-0F21-C22E-BD0B-FF08CBC5DF35" type="line" y="0mm" x="40 mm" /> <item id="438D4845-0870-0774-2B04-FF08CBC812AE" type="line" y="20 mm" x="80 mm"/> <item id="CFE591E3-BCEC-59A1-1F79-FF08CBC9AFB7" type="line" y="40 mm" x="40 mm" /> <item id="DA7D6038-C95B-5C18-E0C3-FF08CBC97167" type="line" y="20 mm" x="0mm" /> </points> </item> </paths> </item> </frames> </item> </pages> </document>

ShapeFrame XML

The main definition of a shape comes from its "paths" property (see lower). An important note is that when updating or creating such a frame through XML, you must:

  • Have all path points in positive coordinates (x/y), including if possible any bezier curves, and start one point at x=0, and one (or the same) at y=0

  • Set the frame's width and height to the bounding coordinates (maximum x/y of any point, including any bezier curves)

  • Ensure that the proportions of width/height match the proportions of the bounding coordinates of the path points

These same notes apply when editing the clippingPath of a TextFrame object, or the frameClippingPath of an ImageFrame.

Paths XML

The Paths XML corresponds to an object of type Document Object Model - Paths. This (hierarchically) contains:

An individual Path Point has a "type" property (Editor Enumerations - PathPointType), where:

  • "line" (the default) only requires x and y

  • "bezier" also requires controlLeftX, controlLeftY, controlRightX, and controlRightY

All coordinates of a path point are relative to its parent's topleft coordinate (eg a ShapeFrame). Starting a line in that corner would be x=0 and y=0

Important update if you create/modify path points of shape frames in the XML!

From version 2021.0.0.8/6.3.0.6 onwards, frames for which the path bounds and frame bounds are not aligned will be moved/resized to get them aligned. The paths are not touched, but the frames are updated. This means that visually there will be no difference, but it could impact your document if other frames are anchored to the updated frames.

The path bounds and frame bounds are always aligned for shape frames created by CHILI publisher, so frames will only be updated if you create/modify path points of shape frames in the XML.

All information on this page must be treated as External Restricted, or more strict. https://www.chili-publish.com/security