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

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

New Here ,
Sep 01, 2024 Sep 01, 2024

Copy link to clipboard

Copied

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

Views

122

Translate

Translate

Report

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

Copy link to clipboard

Copied

.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Hi,

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

 

MarcAutret_0-1725362049690.png

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

Votes

Translate

Translate

Report

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