Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to Determining TextFrame Position in IDML Using XML and Python: Handling Negative Values

New Here ,
Sep 01, 2024 Sep 01, 2024

After extracting the IDML file, I checked the `TextFrame` elements in the `Spreads.xml` file.

 

However, when I calculate the position using a matrix, I get negative values.

 

The document size and the `TextFrame` size are calculated correctly, but I’m not sure how to properly calculate the position.

 

Can you help me with this?

 

 

* I am using Python.

 

 

<Title renamed by MOD>

TOPICS
How to , Scripting , SDK
219
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2024 Sep 02, 2024

.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 03, 2024 Sep 03, 2024
LATEST

Hi,

Coordinate spaces in IDML are detailed in the specification. The origin of the Spread space is its center point:

 

MarcAutret_0-1725362049690.pngexpand image

Then you use ItemTransform and PathGeometry elements to get space-relative coordinates, in pt.

 

More on this topic:

https://indiscripts.com/blog/public/data/coordinate-spaces-and-transformations-5/CoordinateSpacesTra...

 

Best,

Marc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines