Change the size of the Page with a Script

I did work in Illustrator which is defined as two-page spreads on 1 work plan.

I need to convert this unique double pages.

I.e. If for half of the documents, I need set the anchor point of the document at the top on the left and half the width of the artboard.

For the other half of the documents, I need set the anchor on the right and half the width.

Is this possible with scripts?

I look around online to find ways to access the document and anchor point using the script, but not can't find all resources.

Thanks for any help that can be offered.

Edit: It is also possible to create a new work plan with a script and assign it a name?

Here you go, this script splits the artboard into two

// carlos canto
// http://forums.adobe.com/message/5380624#5380624

var idoc = app.activeDocument;
var ab = idoc.artboards[0];
var abBounds = ab.artboardRect;// left, top, right, bottom

var ableft = abBounds[0]; // 0
var abtop = abBounds[1]; // 612
var abright = abBounds[2];
var abbottom = abBounds[3];
var abwidth = abright - ableft; // 792 // width
var abheight = abtop- abbottom; // 0 // height

var half = ableft + abwidth/2;

var abright2 = half;
ab.artboardRect = [ableft, abtop, abright2, abbottom];

var ableft2 = half;
var newAB = idoc.artboards.add([ableft2, abtop, abright, abbottom]);

Tags: Illustrator

Similar Questions

  • Change the page size, unexpected behavior, CC

    Hi, having a problem with the changes after the change of the page. In a nutshell if I get cardboard PMPoint transformation (0,0) before a change of page size, the result is exactly as planned, the origin of the page in the editing table. After I change the page size using kSetPageSetupPrefsCmdBoss and run the transformation even recalibrated value is identical before changing the page size.

    Here's some quick code and output to illustrate. PageSizing:; DoYourThing() called and made the intial processing, prints the output in InspectTransformation(), then call ChangePageSize() and remembers InspectTransformation().

    Sub PageSizing: DoYourThing()

    {

    IDocument* theFrontDoc = Utils<ILayoutUIUtils> ()->GetFrontDocument();

    if (theFrontDoc is nil) { cost < < "Need a doc." } < < endl; return; }

    fDoc = theFrontDoc;

    GetPageSpreadRefs()1); Download the UIDRef from the 1st page and spread

    if (fPageRef == UIDRef:gNull) { cost < < "Invalid Page" UIDRef. < < endl;} return; }

    if (fSpreadRef == UIDRef:gNull) { cost < < "Invalid spread UIDRef." } < < endl; return; }

    cost < < "before changing the size of the Page." << ENDL ;

    InspectTranforms();

    bool16 sizeChangeResult = ChangePageSize();

    if (sizeChangeResult) {

    cost < < "after changing the size of the Page." << ENDL ;

    InspectTranforms();

    }

    }

    Sub PageSizing: InspectTranforms()

    {

    do {

    PMPoint leftTopPage (0, 0); / / Page coords

    InterfacePtr<IGeometry> pageGeo (fPageRef UseDefaultIID(());

    PMMatrix page2Pb =:pageGeo InnerToPasteboardMatrix();

    PMRect pageBoundsInPasteboard = pageGeo->GetStrokeBoundingBox(page2Pb);

    PMPoint pageOriginInPasteboard is pageBoundsInPasteboard. LeftTop ();

    Helper:PrintPoint(pageOriginInPasteboard, 'Origin of the dough pension Page.');

    InterfacePtr<ITransform> pageTransform (fPageRef UseDefaultIID(());

    PMPoint leftTopInPasteboard = leftTopPage;

            :: TransformInnerPointToPasteboard() pageTransform, & leftTopInPasteboard);

    Helper:PrintPoint(leftTopInPasteboard, "transformed the point (0,0) in cardboard coords.") );

    } while (kFalse);

    }

    bool16 PageSizing: ChangePageSize()

    {

    bool16 retval = kFalse;

    do {

    InterfacePtr<IPageSetupPrefs> docPrefs (fDoc->GetDocWorkSpace(), UseDefaultIID());

    if (docPrefs is nil) { cost < < "Nile IPageSetupPrefs" < < endl;} Break; }

    InterfacePtr<ICommand> pageSizeCmd (CmdUtils:kSetPageSetupPrefsCmdBossCreateCommand());

    if (pageSizeCmd is nil) { cost < < 'No command' < < endl;} Break; }

    InterfacePtr<IDocSetupCmdData> cmdData (pageSizeCmd IID_IDOCSETUPCMDDATA);

    if (cmdData is nil) { cost < < 'Data command nothingness' < < endl;} Break; }

    PMPageSize currPgSz = docPrefs->GetPageSizePref(); / / 612, 792

    PMPageSize newPgSz (currPgSz. OutputWidth() + 50, currPgSz. OutputHeight () + 50);

    DocPageBinding link = Utils<ILayoutUtils> ()->GetDocumentPageBinding(:GetUIDRef(fDoc));

    cmdData->SetDocSetupCmdData(:GetUIDRef(fDoc),)

    newPgSz,

    docPrefs->GetNumPagesPref(en)

    docPrefs->GetPagesPerSpreadPref(en)

    docPrefs->GetWideOrientationPref(en)

    Liaison);

    Error code ec = pageSizeCmd ProcessCommand() CmdUtils:);

    retval = (ec == kSuccess);

    if (! retval) { cost < < "Resize the page command failed." } < < endl;}

    } while (kFalse);

    Return retval;

    }

    The output

    consoleOutput.png

    As you can see the origin of the page is different after the order of page size, but the transformation returns the same value of 0.0.

    Am I missing something about transformations or the order of page size?

    Thanks for any help. Mike

    Hello Mike,.

    you was not assuming that the upper left corner of a page in coordinates (0, 0) pasteborad. That is right. But you assuming that the upper left corner of a page in internal coordinates is (0, 0). And it is wrong. The origin of the page in internal coordinates is (0, 0) after resizing.

    Markus

  • How can I change the page size of a pdf document so that I can check on my iphone more clearly?

    How can I change the page size of a pdf document so that I can check on my iphone more clearly?

    This is way beyond what can be done with PDF, except by copying the text and make a new document in Word or something.

    That said, Adobe Reader on Windows may display the text AS IF the PDF file has been divided. It's the text reformatting. It may be possible in Reader for iPhone, you can try the player for ios forum.

  • Change the page size and text in Firefox 35.0.1

    I had a small red P at the top right of Firefox that changed the page size and the fonts that I lost after a reset: How do I get it back?

    Do you mean this extension?

    You can check the "Old data Firefox" folder on the desktop to see what extensions you previously had.

  • Change the page size - grayed out of boxes

    I'm changing the page size of the pages within a document. Apparently, you're supposed to select the pages in the Pages panel and then change the height and width of the Panel settings. My height and width boxes are grayed out. What have I done wrong?

    Your screenshot shows you the active Selection (the black arrow) tool, not the Page tool (the third tool from above).

  • Hi, how do I change the orientation of the page with headers and footers for facing pages

    Hello

    How to change the orientation of the page with headers and footers for facing pages in CS5

    Turning the page is only for the formatting of data - the page is not literally transformed for printing.

    In most print even if the pages of a book are enabled for the landscape, the header and the footer are still in the same position.

    If you need pages in landscape mode with headers and footers in a different location - you need to do these pages in the section "Master Pages" of the Pages panel

    Then apply these new Master Pages to the pages in your document.

    http://helpx.Adobe.com/InDesign/using/master-pages.html

    Note - it is not usual to have a different orientation for the headers and footers.

  • How to change the page numbers after adding &amp; save page numbers in the pdf document - need to change the existing page printed on the upper right in the header numbers

    How to change the page numbers after you add and save the page numbers in the pdf document - need to change the existing page printed on the upper right in the header numbers.

    These page numbers were initially created using Acrobat PDF header and footer.

    I have a 750 page pdf document that I've created.

    I have to sometimes the pages up and down after that I added the page numbers in the document by using the Header_Footer tool on the right column of tools.

    But after you save the document, if I get a few pages around, I can't go back and change the page numbers.

    I thought that the page numbers, as indicated in the header and footer must have changed automatically, but I guess that once its print, that it cannot be edited - is that, as what is?

    So I guess we should always first get a copy without numbers of pages before confirming the documents and the creation of an index.

    A way to remove these page numbers already there and add new page numbers.

    Its a lot of work to align 750 court documents and then realize that you must move some and then realize the page numbers cannot be changed and thus begin to do this all over again to compile which can take about 10 hours.

    My question is quite simple, but I hope that overall, I got my point. Sorry if I made it is too complex.

    If no simple way, want to know if anyone has another different tool or a few recommendations to better highlight what I'm doing wrong.

    Thank you for your review and response.

    You should be able to update with tools - Pages - header & foot-

    Update... It not work for you?

    If this isn't the case, then try to remove from this menu and then re - adding them.

    Tuesday, June 23, 2015 23:55, Fortune Mile [email protected]>

  • find a block of text on the page with the name of script

    Hi all

    I need to create a script for

    find a block of text on the page with the script titled "xxx".

    and read its contents into a variable.

    The content of the text block is a number.

    Thank you

    Hello Roberto,

    Welcome to the forum,

    This is the textFrame marked on the current page.

    var myLabel = "Foo", // change to label
          myPage = app.properties.activeWindow && app.activeWindow.activePage,
          myTextFrames = myPage.textFrames.everyItem().getElements().slice(0),
          l = myTextFrames.length,
          myVariable
    
    while (l--) {
        if (myTextFrames[l].label != myLabel) continue;
        myVariable = myTextFrames[l].contents;
        break; // presuming there's only one "Foo" labeled frame on the page
        // Otherwise you'll nead an array
        }
    
    alert(myVariable)
    

    Trevor

  • Change the Page numbers in the index

    Hello

    I have a catalog and I added two pages in the middle of the catalog. Now, due to the addition of two pages, I need to update the page numbers on the index with the new page numbers. I only need to increase each of the page by two numbers, but that starts only at a certain point. Thus, for example, on one of the index I have, 1-70 page numbers may remain the same, since the two extra pages were added AFTER page 70. But every number after 70 must increase by 2.

    I have a find and replace script. I create a table in excel and drop into the document. The script then takes any word or number that is listed in column A and replace it with what is in column B. I used initially this script to find and replace in the catalog product codes, and it worked great, because all the product codes were quite unique.

    Try to use this same script to change the page numbers, but she totally fizzled. The problem is that the same number is repeated later in the table, so the script has the table constantly replace all numbers with the first two. So, here is a small sample of my table:

    Col Col B

    423 425

    422 424

    421 423

    420 422

    But when I run the script, here is what it will turn into:

    Col Col B

    423 becomes 425 425

    422 becomes 424 424

    421 becomes 425 423 becomes 425

    420 becomes 424 422 becomes 424

    Because it alters the table, all corresponding numbers in the document then will increase to 425 or 424.

    Is there a way to ensure that the script does not change the information in the table that she uses as a reference?

    Here is the script below. I didn't write (makes a very nice person on these forums) and don't know anything about the scripts.

    the_table = app.selection [0] .tables [0];
    app.findChangeTextOptions = null;
    with (app.findChangeTextOptions)
    {
    caseSensitive = true;
    wholeWord = true;
    }
    app.findTextPreferences = null;
    app.changeTextPreferences = null;
    for (row = 0; row < the_table.rows.length; line ++)
    {
    If (the_table.rows [row] .cells [0] .silence == ")
    continue;
    app.findTextPreferences.findWhat = the_table.rows [row] .cells [0] .silence;
    app.changeTextPreferences.changeTo = the_table.rows [row] .cells [1] .silence;
    app.activeDocument.changeText ();
    }

    Thank you very much!

    It should work, but make sure you do backup first. I'm not going to say once: first make a backup copy. Yes, I said that you should make a backup first!

    Copy the following script, paste it into an editor appropriate - Adobe ESTK which comes with InDesign is good enough. Save it as "omgwrongnumbers.jsx" in your user Scripts folder. Select as little text as possible, the script will be blindly increment (or decrement) all numbers in the range. And then double-click the script runs.

    //DESCRIPTION:omg the page numbers are all wrong!
    // A Jongware Script 18-Aug-2010
    if (app.documents.length == 0)
    {
         alert ("Oh give me some text to play with :'(");
         exit(0);
    }
    if (app.selection.length != 1)
    {
         alert ("We can't go on like this. Select some text first.");
         exit(0);
    }
    
    myDialog = app.dialogs.add ({name:"omg the numbers are wrong!",canCancel:true});
    
    with (myDialog)
    {
         with (dialogColumns.add())
         {
              with (dialogRows.add())
                   staticTexts.add ({staticLabel:"First to change"});
              with (dialogRows.add())
                   aBox = integerEditboxes.add({editContents:"1"});
              with (dialogRows.add())
                   staticTexts.add ({staticLabel:"Last to change"});
              with (dialogRows.add())
                   bBox = integerEditboxes.add({editContents:"99999"});
              with (dialogRows.add())
                   staticTexts.add ({staticLabel:"Add or subtract this value"});
              with (dialogRows.add())
                   cBox = integerEditboxes.add({editContents:"2"});
         }
    }
    if (!myDialog.show())
    {
         myDialog.destroy();
         exit(0);
    }
    first = aBox.editValue;
    last = bBox.editValue;
    step = cBox.editValue;
    
    if (first < 1 || first > last || step == 0)
    {
         alert ("Now you're pulling my nose arentya");
         exit(0);
    }
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "\\b\\d+\\b";
    list = app.selection[0].findGrep(true);
    changes = 0;
    for (i=0; i= first && n <= last)
              changes++, list[i].contents = String(n+step);
    }
    alert ("Number of changes: "+changes);
    
  • Cannot change the page editable errors

    Hi all

    I created a Web site that uses DWT editable regions as well as editable ice regions.

    http://www.p3sf.com/

    The index.html page isn't an attached template and all the other pages are attached to the model internal.dwt

    I created regions editable in the DWT and also created the boxes of ice in the model. Now, when I go to a page and press ctrl + E, and then press the button change, I get errors.

    On the index.html page (which is not attached to a model), I get "you cannot edit or duplicate this page because it contains the invalid supplement. "Reason: there is an editable region that contains prohibited tags.

    I went and looked for these tags, but have no idea of what they are. And whereas I have created the page with Dreamweaver and added parts of ice, why would I errors.

    On other pages such as http://p3sf.com/events.html , I used to get a different error, but now I get the same error as above.

    Help, please! This ice is supposed to make things easier, but I did have to work for one of my many sites yet.

    Thank you
    Leslie

    Hello, Leslie.

    First of all, your index page does not validate because you have nesting problems (some of your labels are not properly closed before starting a new tag). However, aside from that, you can have scripts inside InContext Editing regions. The error that you receive when you use InContext Editing is caused by the script inside the form located in your editable region. Move the script in the editable area and InContext Editing does not return the error.

    The line of the related help page that apply to the present case is: there is an editable region that contains prohibited tags. The forbidden tags include SCRIPT, map, AREA, OBJECT, and EMBED.

    Please let me know if you need more help with this.

    Best regards
    Corey

  • My screen iphone6 is cracked and in my country, they can only change the iphone with a new one and with a very high price. Is there anyway that I could replace just the screen?

    My screen iphone6 is cracked and in my country, they can only change the iphone with a new one and with a very high price. Is there anyway that I could replace just the screen?

    No, if you want to keep all rights to the service or support from Apple. Not to mention the fact that it then will be bork Touch ID and make the phone unusable if ever, you restore or update of iOS.

    Apple doesn't sell parts of the iPhone. There is no legitimate sources for replacement screens.

  • HP Deskjet 710C does not print colors (also after changing the cartridge with a new one)

    HP Deskjet 710C on Windows XP

    Problem: Printer does not print color. Black printing works. It also does not print color now, I changed the color with a new cartridge. Remove the printer from Windows XP and reinstall also does not resolve it. Also by using the option in Windows/printer driver for the cleaning cartridge has failed. Anyone know a solution to this?

    There is a document about the lack of color of the issues on the printer Deskjet 710C that can be found here.

    I hope this helps!

  • Another user changed the row with a primary key oracle.jbo.Key]

    I see many discussions about this error, but still cannot understand the difficulty that I need in my scenario.

    I am an Oracle Developer and completely new to ADF, please bear with me.

    I use JDeveloper 11.1.1.9.0

    My scenario:

    Creates an object editable view (UVO) with sub selects in the query, which is from several db tables.

    Creating a table using the UVO

    When I try to update a field in the table, and then click the validate, I get the error message:

    Another user changed the row with a primary key oracle.jbo.Key]

    Can someone explain in what scenarios I see this error and how do I solve this problem?

    Try the viewObject execution after validation and reQueryOnCommit set to true

    For details see - binary: a reason more for "Houston-25014: another user has modified the line containing oracle.jbo.Key primary key '

    Ashish

  • Prevent the user from changing the page in URL - Apex 5

    Dear community of Apex,

    We seek to protect our handling of URL pages.  The protection of session state is enabled, and each page has page value «Arguments must have Checksum» access protection  However, the documentation seems to discuss in order to prevent the user from element values in the URL.  We want to prevent the user to change the page ID in the URL.  Currently, a user is able to hack the URL and take in the middle of a wizard process for example.  Is it possible to stop this?  Other that an element of creative previous train stop check.

    * Version: Application Express 5.0.1.00.06

    Thank you

    Barry

    bSamuel wrote:

    We seek to protect our handling of URL pages.  The protection of session state is enabled, and each page has page value «Arguments must have Checksum» access protection  However, the documentation seems to discuss in order to prevent the user from element values in the URL.  We want to prevent the user to change the page ID in the URL.  Currently, a user is able to hack the URL and take in the middle of a wizard process for example.  Is it possible to stop this?  Other that an element of creative previous train stop check.

    Hi Barry

    Affecting the security attribute Access Page Protection page No. URL Access and navigate between pages using the type of the Page Management Branch (uncheck the option creates a branch using redirection page in the Wizard) will avoid this:

    No URL access -Page can not be found using a URL, but the page can be the target of a type of Page Management Branch, is not doing a URL redirect.

    It is a little more restrictive that a normal direction of the session state values cannot be positioned or erased declaratively in the branch, but is not often necessary in a several step wizard, and it's pretty simple to work round using prior processes - or post-branche or by referencing the item values directly from other pages.

  • I create my web and download it to Dreamweaver, but it came as I wanted. Now, I need to change the page, but it does not allow me to do so because that is block need help

    Hello

    I create my web and download it to Dreamweaver, but it came as I wanted. Now, I need to change the page, but it does not allow me to do so because that is block need help

    First, set the folder of your site.  Go to Site > new Site > tell DW where to save files to the local site.

    http://layersmagazine.com/defining-site-Dreamweaver.html

    Nancy O.

Maybe you are looking for

  • very noisy fan

    very noisy fan does not stop

  • Equium A200-1AC - cannot remove the second HARD drive cover

    I have an Equium A200-1AC, there is also a second HARD-drive Bay, but I can't get the cover off the coast, can anyone help?

  • lnovo tactile a7000 responds only partially...

    Lenovo A7000 touchscreen does not... I contacted the customer service who asked me to download lnovo companion to diagnose the problem. Screen touch not working in a vertical jet... .WAT do now... help pl...

  • TCP IP not enough memory

    I do tcp ip asks the customer side my executable (not in development mode I test my development mode my client application does not show enough memory but in application .exe it shows not enough memory very soon). Is there a solution to this i have a

  • WEP, wpa or wpa2

    I have a TP-LINK wireless routerI work with laptop and I want to change the configuration of the router to WPA2 instead of WEPBut every time I try to make the change I meet an error that the network settings do not match the settings of the computer