Highlighted

Top, Left and Transform properties for words <span> while exporting fixed layout html

New Here ,
Mar 15, 2020

Copy link to clipboard

Copied

Hi Team, 
We are writing an extend script to parse the InDesign object model, what properties in the paragraphs and words object is used to find the left, top and transform CSS values for the <p> and <span>.
Screen Shot 2020-03-15 at 2.05.39 AM.png

 
What properties of the word or character object is used to find the left and top?

Screen Shot 2020-03-15 at 2.07.52 AM.png

 

Topics

Scripting

Views

56

Likes

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

Top, Left and Transform properties for words <span> while exporting fixed layout html

New Here ,
Mar 15, 2020

Copy link to clipboard

Copied

Hi Team, 
We are writing an extend script to parse the InDesign object model, what properties in the paragraphs and words object is used to find the left, top and transform CSS values for the <p> and <span>.
Screen Shot 2020-03-15 at 2.05.39 AM.png

 
What properties of the word or character object is used to find the left and top?

Screen Shot 2020-03-15 at 2.07.52 AM.png

 

Topics

Scripting

Views

57

Likes

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
Adobe Community Professional ,
Mar 17, 2020

Copy link to clipboard

Copied

Hi extendMan,

do you mean you like to know the position of a character on the page?

 

You could use properties like baseline or endHorizontalOffset of the first and last insertion point of the character.

However this will not be super precise. Also be problematic if the text frame is rotated. Another option is to convert the character to outlines and get the geometric or visible bounds. That could be sufficient.

 

character.createOutlines( false )[0].geometricBounds;

 

Later remove the object.

 

Regards,
Uwe Laubender

( ACP )

Likes

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
Reply
Loading...