Copy link to clipboard
Copied
Hello everyone, sorry if this has already been answered before.
I am trying to make a single page in indesign that is auto-adjustable based on the content. The content has a header, a footer, and a content area. Depending on the content, I want the page to auto adjust its size. Sometimes the content can be 10 lines, sometimes 50 lines and sometimes 500 lines. In all cases, the page should remain single and auto adjust itself. TIA.
Quick and dirty:
'############
' script start
' (C) www.adobescripts.com
'############
set myInDi = CreateObject("InDesign.Application")
set myDoc = myInDi.ActiveDocument
set mySel = myInDi.Selection.Item(1)
call mySel.Fit(1718906723)
myDoc.DocumentPreferences.PageHeight = mySel.GeometricBounds(2) - mySel.GeometricBounds(0)
myDoc.Pages.Item(1).AppliedMaster = myDoc.MasterSpreads.Item(1)
mySel.GeometricBounds = myDoc.Pages.Item(1).Bounds
'############
' script end
'############
One condition
...Copy link to clipboard
Copied
Hi,
Have a look at this: Liquid and alternate layouts in InDesign (adobe.com)
Copy link to clipboard
Copied
An auto adjustable page is not possible in InDesign.
Copy link to clipboard
Copied
Is it possible in PDF or any other Adobe products? Thanks.
Copy link to clipboard
Copied
No problem through scripting - are you on PC or Mac?
Copy link to clipboard
Copied
I am on PC. Has someone already solved this??
Copy link to clipboard
Copied
Yeah, piece of cake, I've done this before in my BuildCatalog tool.
Would have to extract this part - but need more info from you - only height should be dynamic - or width as well? If yes - how, on what conditions?
Or it would just have to be the same as all objects on the current spread / as selection?
Copy link to clipboard
Copied
If it should be AUTO adjusting, such a script has to run constantly, I believe that is not what was asked: I took it as auto adjusting like auto sizing text frame - but now for a page... maybe I misunderstood.
Copy link to clipboard
Copied
Only the length at this point. Thanks.
Copy link to clipboard
Copied
Only the length at this point. Thanks.By @Mahendra5E19
Are you working on this document - or do you need it for DataMerge?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks, can you send me - maybe on priv - example INDD document for testing?
Copy link to clipboard
Copied
If you have header + body + footer, then it would be easiest, if you can have it as one TextFrame - not sure if Table could handle it...
So, initially, contents of your TextFrame would be three paragraphs:
1) header - placed as a group of objects - InLine.
2) empty - you'll copy your "body" here,
3) footer - same as header.
This would make script EXTREMELY simple.
Copy link to clipboard
Copied
Yes, we are planning to do exactly that so as not to touch header and footer all the time. What is 'priv'? I will send the file later today.
Copy link to clipboard
Copied
Private message - just click on my (nick)name.
Copy link to clipboard
Copied
Just sent - thanks!
Copy link to clipboard
Copied
Quick and dirty:
'############
' script start
' (C) www.adobescripts.com
'############
set myInDi = CreateObject("InDesign.Application")
set myDoc = myInDi.ActiveDocument
set mySel = myInDi.Selection.Item(1)
call mySel.Fit(1718906723)
myDoc.DocumentPreferences.PageHeight = mySel.GeometricBounds(2) - mySel.GeometricBounds(0)
myDoc.Pages.Item(1).AppliedMaster = myDoc.MasterSpreads.Item(1)
mySel.GeometricBounds = myDoc.Pages.Item(1).Bounds
'############
' script end
'############
One condition - no error checking so "main" TextFrame needs to be pre-selected.