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

Page resize based off of compound path lowest location.

Explorer ,
Jul 08, 2020 Jul 08, 2020

Copy link to clipboard

Copied

Ok, I am trying to do something and have decided to try a different approach...

 

I have a series of pages set up as follows. 

I have a page.             A layer with a logo             A layer of text        A second layer of text

-------------                  -------------                             -------------                  -------------

|                |                 |      S$$    |                             |                |                  |                |    

|                |                 |                |                             |     Text    |                  |      text     |      

|                |                 |                |                             |                |                  |       text    |      

-------------                 -------------                             -------------                   -------------   

 

I am turning the text to outlines and want to resize the page to fit the lowest bound of the <compound path> created.

psuedocode would be

CreateOutline()

var cutLine = <compound path> Y + height

resize(CoordinateSpaces.INNER_COORDINATES,
        AnchorPoint.CENTER_ANCHOR,
        ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,
        [page.width, cutLine])
 
Any help would save my life!! An

 

TOPICS
Scripting

Views

211

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

correct answers 2 Correct answers

Community Expert , Jul 09, 2020 Jul 09, 2020

FWIW: Would you like to do this with a facing pages document where the pages are left or right from a spine?

Be warned, that in the moment you change the width of a page the edge of a page will snap to the spine.

Well, and in the same moment the object could be partly or entirely outside of the page on the pasteboard.

 

That means: In this case you have to move the object as well. Not only to resize the page.

 

This thread should answer all or nearly all of your questions:

 

Is there a script to

...

Votes

Translate

Translate
Explorer , Jul 21, 2020 Jul 21, 2020

That definitely helped!


What I finally did was this incase it can help anyone in the future.

 

currentPage.textFrames.everyItem().createOutlines();

        //Select items on current page
        for (var j=0; j<currentPage.pageItems.length; j++)
        {
            currentPage.pageItems.everyItem().select();
        }

        //Get outer bounds of selection for resize
        var gb = app.activeDocument.selection[0].geometricBounds;

        //Resize vertical banners
        currentPage.resize(
...

Votes

Translate

Translate
Community Expert ,
Jul 09, 2020 Jul 09, 2020

Copy link to clipboard

Copied

FWIW: Would you like to do this with a facing pages document where the pages are left or right from a spine?

Be warned, that in the moment you change the width of a page the edge of a page will snap to the spine.

Well, and in the same moment the object could be partly or entirely outside of the page on the pasteboard.

 

That means: In this case you have to move the object as well. Not only to resize the page.

 

This thread should answer all or nearly all of your questions:

 

Is there a script to shirnk the Artboard to a selected Textbox?

cbishop01, Jan 08, 2018

https://community.adobe.com/t5/indesign/is-there-a-script-to-shirnk-the-artboard-to-a-selected-textb...

 

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 21, 2020 Jul 21, 2020

Copy link to clipboard

Copied

LATEST

That definitely helped!


What I finally did was this incase it can help anyone in the future.

 

currentPage.textFrames.everyItem().createOutlines();

        //Select items on current page
        for (var j=0; j<currentPage.pageItems.length; j++)
        {
            currentPage.pageItems.everyItem().select();
        }

        //Get outer bounds of selection for resize
        var gb = app.activeDocument.selection[0].geometricBounds;

        //Resize vertical banners
        currentPage.resize(CoordinateSpaces.INNER_COORDINATES,
            AnchorPoint.TOP_LEFT_ANCHOR,
            ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,
            [2000, gb[2]] );

Thanks all! Especially Uwe who was helping me try a different approach in a seperate thread.

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
Adobe Employee ,
Jul 20, 2020 Jul 20, 2020

Copy link to clipboard

Copied

Hi there,

 

I'm hoping that the issue is resolved for you. 

If the above-mentioned solution or suggestion helped, please mark it correct.

If not, do let us know so that we can assist you further.

 

Regards,

Sheena

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