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

Refreshing Frame or Document

Explorer ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

Hello All,

I am facing a problem in refreshing the document or the Text frame at the Server end. Following is my logic.

I am having threaded frames in the document. Through C++ plugin we are iterating the frames and if the frame is overset we have my own logic to increase the frame sizes to remove the overset. Somehow after doing a resize when I try to check the overset (its in a loop) I still get overset even if the frame is underset.

I tried to use Recompose on Text frames and document but still not able to get the refreshed status. 

 

Has anyone faced this same problem? Can anyone please suggest any solution?

 

Thanks in Advance to all.

 

Regards.

TOPICS
Scripting , SDK

Views

535

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 ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

Hi,

 

Are you able to send a before and after document?

Can you post a snippet of the code you are using to the recompose?

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 ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

Hi,

Thanks for replying well there are multiple ways we tried two of the function I ave copied in the file at attached. We are iterating the threaded frame and passing the Parcel interface to check overset or underset.

 

Thanks & Regards.

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
Community Expert ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

FarzanaA said:

"I tried to use Recompose on Text frames and document but still not able to get the refreshed status."

 

Hi FarzanaA,

spoken in ExtendScript terms: does it make a difference if you enable or disable redraw in the script preferences?

app.scriptPreferences.enableRedraw // boolean value

Or does enableRedraw not matter or exist if you are developing with C++ ?

FWIW: It's part of the DOM documentation of InDesign Server.

 

Regards,
Uwe Laubender

( ACP )

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 ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

Hi ,

I will definitely try this too as  I did try through script TextFrame.Recompose and app.Document.Redraw. 

 

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
Community Expert ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Another idea:

Move one path point of a text frame to a different position and move it back to its original position.

 

Regards,
Uwe Laubender

( ACP )

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 ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hi Laubender,

Actually I am setting the new height of the text frame in the loop to fit the content.through SetPathBounding().

I tried your earlier option. Thanks for that, atleast the jobs are not going in loop now but still does stop the loop at the exact point. For e.g if the text is fitting at 40 mm it stops at 81mm.

 

Thanks & Regards

Farzana.

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
Community Expert ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hi Farzana,

setting the bounding box is one thing.

Moving a single path point after the bounding box is set is a totally different thing. After flowing in the text this should reflow the text if the new position is far from its original position. Move it back. Text should reflow again. Then determine if there is overset or not.

 

Regards,
Uwe Laubender

( ACP )

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 ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hi Laubender,

 

Ok got it. Thanks for the suggestion will try this too and let you all know. 

Thanks once again for helping out.

 

Regards

Farzana.

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
Community Expert ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Non-recomposing stories/frames can be a real pain in the butt. But I've never seen a story being reported as overset when it's underset. How do you know that the frame is underset? If you opened the document on your desktop you may see a story as underset while on the server it's overset: this can be caused by a font difference. The only way to make sure is to export the document to PDF on the server and inspect that one, not the downloaded indd file.

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 ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hi Peter, 

Yes you are correct even if the frame is underset it shows overset on the server till certain iterations. As mentioned earlier this process is in the loop. So not sure because of the continous iteration we are facing this issue.

We also generate the PDF at the end of the process and the output is same as in indd when opened on desktop. The fonts are correct. 

 

Regards

Farzana.

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 ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

You mention that you recompose on the actual frames, but not the particular interface and method. That might be the problem, better recompose the entire story.

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 ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hello Dirk,

 

"You mention that you recompose on the actual frames, but not the particular interface and method."

Can you please explain this in slight detail. and on recomposing entire story. Do you mean Document? 

 

Thanks &Regards

 

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 ,
Jul 31, 2021 Jul 31, 2021

Copy link to clipboard

Copied

Hi @FarzanaA 

You can try document recomposing method  you can use sleep method too.

for example whenever you are increasing your textframe inside the loop every time you recompose

after recomposing you check wheather textframe is underset or not.

app.documents[0].recompose(); and you acn use $.sleep(200) 

 

Thanks

Anupam

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 ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

That's not the good idea to recompose and sleep inside loop.

-Sumit

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 ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

Sorry, on my first attempt I could not see into your Overset Check.txt somewhere above, the forum's document viewer turned just black with Safari. Now revisited it with Chrome.
I'm not sure why you are dealing with the ITextParcelList given all the warnings in the header, I'd instead use the IFrameListComposer. On the other hand it's been several years since that I had to do anything in that area.

Ah I see, the IsParcelOverset looks pretty similar to SnpTextModelHelper, while your IsTextFrameOverset has undergone quite some rework. So, could you give IFrameListComposer a try?

 

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 ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

LATEST

Hi Dirk,

We have tried that too. below is the snippet 

 

void RecomposeFrame(UIDRef oItemRef)
{
       InterfacePtr<IGeometry>iiGeometry(oItemRef, IID_IGEOMETRY);
       if (iiGeometry == nil)
             return;

       InterfacePtr<IMultiColumnTextFrame> iiTextFrame(oItemRef.GetDataBase(),          Utils<IFrameUtils>()->GetTextFrameUID(iiGeometry), IID_IMULTICOLUMNTEXTFRAME);
        if (iiTextFrame == nil)
       {
              return;
        }
        InterfacePtr<IFrameListComposer>iiFrameComposer(iiTextFrame, IID_IFRAMECOMPOSER);
        if (iiFrameComposer != nil)
               iiFrameComposer->RecomposeThruLastFrame();

}

 

unless we have missed any thing here not sure. 

 

Thanks & Regards

Farzana.

 

 

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