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

Wrong X,Y values for Texts

Explorer ,
Mar 23, 2022 Mar 23, 2022

Copy link to clipboard

Copied

Hello, 

I'm using indesign sdk 16, If I try to get X,Y positions using GetXPosition() and GetYPosition()/GetCompositionYPosition().

Sometimes I get bad values if I use the indd project file, these values are far better if I use the idml project file instead.
Does anyone have any idea about this problem and how to actually fix it?

Is the indd broken? 

Sometimes even if I use the idml the result is very bad.

Thanks.

TOPICS
Import and export , Scripting , SDK

Views

218

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 ,
Mar 23, 2022 Mar 23, 2022

Copy link to clipboard

Copied

Hi @Amine9, I use the scripting API, not the SDK, so I can't answer, but it might be helpful if you could include a test file in which you can demonstrate and reproduce the erroneous results. There might be reasons why different values are given—eg. differing coordinate spaces, or, I don't know, auto-sizing context. A demo file might help a lot.

- Mark

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
Explorer ,
Mar 23, 2022 Mar 23, 2022

Copy link to clipboard

Copied

Hello Mark, 

Thanks for the quick response, I'm not sure if I'm able to share a code snippet, will check and get back to you.

I don't think it's a scaling problem, because the X,Y values I received are all negative.

Thanks.

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
Engaged ,
Mar 23, 2022 Mar 23, 2022

Copy link to clipboard

Copied

Hello,

If you use functions such as GetPathBoundingBox() then these X values are with respect to the left side of the pasteboard. So, to these values, you need to add the page width (facing pages documents) or a half page width (non-facing pages).

Note that if the document is re-sized, the pasteboard is not also re-sized, and the X position functions fail. If your code uses the getting and setting of the X position of objects, then make sure that documents are not re-sized.

Very best regards,

Olivier

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 ,
Mar 25, 2022 Mar 25, 2022

Copy link to clipboard

Copied

Composition is a time intensive, therefor damage is immediately recorded but recompose is a deferred task.

Before accessing results ensure the composer has completed. Watch out for interfaces and methods with "Recompose" in their name.

 

 

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
Explorer ,
Mar 29, 2022 Mar 29, 2022

Copy link to clipboard

Copied

LATEST

Hello guys,

I'd like to add a detail that can help debug this issue; If I duplicate the page that has this problem, the issue doesn't appear in the duplicated page and all values X and Y are 100% correct.

Thanks.

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