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

Problems with tables, pages and autoflow

New Here ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

Hi to everybody,
I'm writing a javascript that creates a catalogue by copying a model structure into cells of tables. Each brand of the catalogue has is own table, this way it's possible after the importation of the xml (which contains the properties of the catalogue) to remove some articles preserving the layout.
But I have some problems:

1 - How may I create a text-frame in a right page when pages of my document are paired? I tried for example to insert a text frame in the third page (which is in the right side) with:
> var mytextframe = myDocument.pages.itemByName("3").textFrames.add();
the problem is that always it put my text frame in the left page (in this case it puts it in the second page)

2 - How my I make the tables and their contents to be displayed along all the pages i have created, that is how may I do an autoflowing by script? For the insertion of contents in the cell I use the method I've seen in this forum, with the function placeAsset. and i create the table with
> mytable = myTextFrame.tables.add()

I hope I've been clear and I thanks very much in advance everyone may help me! Thanks!!
TOPICS
Scripting

Views

1.9K

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
New Here ,
Feb 13, 2008 Feb 13, 2008

Copy link to clipboard

Copied

Well I've found the error in my script for the first problem.. It was an error in my function used to resize the textFrame after having created it, so that it was created in the right page but after it was moved from is right position.
But I still have the second problem, that is someone knows if it'is possible to flux a table over all the pages it needs to be all displayed? Something like the autoflowing option of the function Place of the object Page? Thanks a lot.
Stefano

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 ,
Feb 13, 2008 Feb 13, 2008

Copy link to clipboard

Copied

Stefano,

You'll need to do the flowing yourself. I use the function below for that. It keeps adding pages and text frames, linking each new text frame to the previous thread, as long as the last added text frame overflows. It may not work for you as it is, but it gets you going.

Peter

flow (app.activeDocument)

function flow (doc)
{
var m = doc.pages[0].marginPreferences;
var gbounds = [m.top, m.left,
doc.documentPreferences.pageHeight - m.bottom,
doc.documentPreferences.pageWidth - m.right];
doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
while (doc.pages[-1].textFrames[0].overflows)
{
var tf = doc.pages.add().textFrames.add ({geometricBounds: gbounds});
tf.previousTextFrame = doc.pages[-2].textFrames[0];
}
}

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
Guest
Jul 29, 2009 Jul 29, 2009

Copy link to clipboard

Copied

LATEST

Hi everybody ,

We used the flow function to keep adding pages and text frames when text frame overflows. This is working fine in InDesign CS3. But it is not working as expected in InDesign CS4 Server.  We have done the basic things like avoiding the usage of active document to eliminate the user interface. Could you please help us if anybody having the script for autoflowing the text in InDesign Server.

Thanks in advance,

rajeshselvaraju

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
New Here ,
Feb 13, 2008 Feb 13, 2008

Copy link to clipboard

Copied

YuppY!!
Thank you very much Peter...
Even if I can't yet obtain all that I want to I was successful in flowing one table, I think this may be a nice start...
Now I'll try to iterate this thing..
Thanks!!
(I'll ask for help if my attempts won't give results)
Bye

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
New Here ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

thanks peter it helps for my request also

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