Highlighted

Page resize based off of compound path lowest location.

Explorer ,
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

 

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.

TOPICS
Scripting

Views

72

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

Page resize based off of compound path lowest location.

Explorer ,
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

 

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.

TOPICS
Scripting

Views

73

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
Jul 08, 2020 0
Adobe Community Professional ,
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 )

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...
Jul 09, 2020 0
Explorer ,
Jul 21, 2020

Copy link to clipboard

Copied

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.

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...
Jul 21, 2020 0
Adobe Employee ,
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

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...
Jul 20, 2020 1