Define coordinates for visual element in idml

I need to process Indesign Idml files, generate an image and overlay other elements on certain elements in html.

Given the Indesign Idml file (which is a zipped xml package) and the visual element in this file is specified (via the tag in xml). Is there any way to find in which coordinates on the image the visual element falls?

+5
source share
2 answers

The hierarchy of containers for an image in an IDML document is as follows:

[] > > PageItem > PlacedImage. , PageItems , . Spread , 0,0 , , InDesign.

( ) IDML. PathPointType PathGeometry, :

<Properties>
            <PathGeometry>
                <GeometryPathType PathOpen="false">
                    <PathPointArray>
                        <PathPointType Anchor="-32.04 -35.04" LeftDirection="-32.04 -35.04" RightDirection="-32.04 -35.04" />
                        <PathPointType Anchor="-32.04 35.04" LeftDirection="-32.04 35.04" RightDirection="-32.04 35.04" />
                        <PathPointType Anchor="32.04 35.04" LeftDirection="32.04 35.04" RightDirection="32.04 35.04" />
                        <PathPointType Anchor="32.04 -35.04" LeftDirection="32.04 -35.04" RightDirection="32.04 -35.04" />
                    </PathPointArray>
                </GeometryPathType>
            </PathGeometry>
        </Properties>

, / , , . ,

ItemTransform="1 0 0 1 509.27559055100005 -123.76377952749999"

... , IDML , 0,0 ( ).

X 0 ( - , ). . BindingLocation (0 , 1 ..). , ItemTransforms .

Y , Adobe, 0 - ( , ).

IDML : http://www.photoshopelementsmac.com/devnet/indesign/documentation.html, .

, ( ), , , ItemTransform

, , ZIP IDML, XML, - :

// Pseudo-code:
// Calculate PageItem GeometricBounds First as noted above
X: (Spread.BindingLocation) + Spread.ItemTransform.tx + PageItem.itemTransform.tx + PageItem.GeometricBounds.Left + PlacedImage.ItemTransform.tx + PlacedImage.GraphicBounds.Left

Y: (Half Spread Height) + Spread.ItemTransform.ty + PageItem.itemTransform.ty + PageItem.GeometricBounds.Top+ PlacedImage.ItemTransform.ty + PlacedImage.GraphicBounds.Top

, : IDML . 72, , .

+10

<PageItem> ItemTransform , , ( XML PageItem , Rectangle, Oval ...).

<PageItem> <PathGeometry> ( IDML ), . JcFx.

IDML: JcFx

+1

All Articles