Highlighted

How to find if text frame is full so that can add new text frame and link to previous one

Explorer ,
May 26, 2020

Copy link to clipboard

Copied

I am working in application in which I need to parse the xml files and display its content in the text frame. The issue is there are almost 500 different xml files and there are lot of variations in its content. 

 

I know I can add new text frame and link it to old text frame but how to find out whether the previous text frame is fully occupied or not. There might be condition that frames can be strached up to 4 to 5 pages and some time it get occupied only in one page. Also will be situations where new text frame shouldn't be part of the earlier thread so from which location should I start the new frame.

 

How to handle this scario. Please help..

 

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi Ashish,

be aware that there could be conditions on text formatting or other contents in stories that would create a permanent text overflow. Even if you are adding text frames to a story.

 

So be very careful with constructions like:

while( myStory.textContainers[ myStory.textContainers.length-1 ].overflows )
{ doSomething() };

 

Always add another condition , perhaps a counter, that could stop the while loop.

 

Regards,
Uwe Laubender

( ACP )

TOPICS
Scripting, SDK, Server developers

Views

811

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

How to find if text frame is full so that can add new text frame and link to previous one

Explorer ,
May 26, 2020

Copy link to clipboard

Copied

I am working in application in which I need to parse the xml files and display its content in the text frame. The issue is there are almost 500 different xml files and there are lot of variations in its content. 

 

I know I can add new text frame and link it to old text frame but how to find out whether the previous text frame is fully occupied or not. There might be condition that frames can be strached up to 4 to 5 pages and some time it get occupied only in one page. Also will be situations where new text frame shouldn't be part of the earlier thread so from which location should I start the new frame.

 

How to handle this scario. Please help..

 

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi Ashish,

be aware that there could be conditions on text formatting or other contents in stories that would create a permanent text overflow. Even if you are adding text frames to a story.

 

So be very careful with constructions like:

while( myStory.textContainers[ myStory.textContainers.length-1 ].overflows )
{ doSomething() };

 

Always add another condition , perhaps a counter, that could stop the while loop.

 

Regards,
Uwe Laubender

( ACP )

TOPICS
Scripting, SDK, Server developers

Views

812

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
May 26, 2020 0
Adobe Community Professional ,
May 26, 2020

Copy link to clipboard

Copied

Textframe has an overflows property, which returns true if there is an overset

 

-Manan

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...
May 26, 2020 2
Explorer ,
May 27, 2020

Copy link to clipboard

Copied

Hi Manan,

 

So does it mean if there is possibility that frame can extend from 1 page to 5 page based on the dynamic contents of xml file I will have to check the frame overflow property 5 times..

 

 

Regards,

 

 

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...
May 27, 2020 0
Adobe Community Professional ,
May 27, 2020

Copy link to clipboard

Copied

Hi Ashish,

 

I am not aware of your workflow its difficult to guess, however if you are adding frames via code then placing the content then you will have to test the overflow in each textframe to decide if a new frame has to be added and linked. You could also look at using Smart Reflow functionality, which will automatically add pages and textframes if the master textframe has an overset. This should save you from all the trouble of tracking overset and creating new/linking frames. Have a look if it suits your needs

https://helpx.adobe.com/indesign/using/threading-text.html#use_smart_text_reflow

 

-Manan

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...
May 27, 2020 1
Explorer ,
May 27, 2020

Copy link to clipboard

Copied

Thanks Manan,

 

Will check if I can handle it with the help of link shared by you..

 

 

 

Regards,

 

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...
May 27, 2020 0
Adobe Community Professional ,
May 27, 2020

Copy link to clipboard

Copied

Hi Ashish,

be aware that there could be conditions on text formatting or other contents in stories that would create a permanent text overflow. Even if you are adding text frames to a story.

 

So be very careful with constructions like:

while( myStory.textContainers[ myStory.textContainers.length-1 ].overflows )
{ doSomething() };

 

Always add another condition , perhaps a counter, that could stop the while loop.

 

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...
May 27, 2020 1
Adobe Community Professional ,
May 27, 2020

Copy link to clipboard

Copied

Hi Uwe,

 

Could you please elaborate and point the scenarios where this could happen. This is new, that i fortunately never faced, would like to know more about this.

 

-Manan

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...
May 27, 2020 0
Adobe Community Professional ,
May 27, 2020

Copy link to clipboard

Copied

Hi Manan,

just format two consecutive lines of text of the same paragraph with property no break.

That would send the text to a permanent overflow.

 

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...
May 27, 2020 0
Adobe Community Professional ,
Jun 02, 2020

Copy link to clipboard

Copied

Ahh, got it that happens because the line width exceeds the textframe width and that can't be resolved without resizing the width of the frame.

 

-Manan

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...
Jun 02, 2020 0
Most Valuable Participant ,
Jun 03, 2020

Copy link to clipboard

Copied

"No Break" is a favourite, but I regularly encounter any and all of these:

 

Hyphenation disabled, asinglelongwordwiderthanthetextframe. Or, all spaces are nonbreaking.

A table with a single row higher than a text frame.

An inline image taller than the text frame.

Text with a left or right indent larger than the width of the frame.

An Indent To Here at the far right of a line.

"Keep with previous/next" applied to multiple long paragraphs.

"Keep all lines together" applied to a single very long paragraph.

Footnote shenanigans: multiple references to some very long footnotes – in a single line of text. (Yeah.)

 

My tactic is to add a frame and then immediately check if it has any contents.

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...
Jun 03, 2020 2
Adobe Community Professional ,
Jun 03, 2020

Copy link to clipboard

Copied

Thanks for adding to the list, i will surely keep an eye on these from now on.

 

-Manan

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...
Jun 03, 2020 0