4 Replies Latest reply on Dec 2, 2009 3:49 PM by lanejd

    HOW TO: Change page size after page is created?

    lanejd Level 1

      Is there a way to change the size of a page after the page has been created? In the documentation, the only way I have seen to set the page size is in a "with" statement right after creating the document. I have need to change the size of the document after a document has already been created. Any ideas?

        • 1. Re: HOW TO: Change page size after page is created?
          [Jongware] Most Valuable Participant

          ...  a "with" statement right after creating the document ...

           

           

          Yes, that's the common way. Why doesn't it work for you?

          Try setting app.activeDocument.documentPreferences.pageWidth and app.activeDocument.documentPreferences.pageHeight. According to the Help, these are read/write properties, so this

           

          app.activeDocument.documentPreferences.pageWidth = "20cm";

           

          should simply work.

           

          [Ed.] Perhaps you were trying to change the size of one single page. Well, standard ID does not support that. It's a document thing.

          1 person found this helpful
          • 2. Re: HOW TO: Change page size after page is created?
            lanejd Level 1

            Yep, that's how I am doing it. I just wanted to make sure that I was doing it correctly. I need to keep debugging then and figure out what the real problem is. I am new to all of this (obviously) and I just needed to make sure I had the idea correct. I didn't mean to use document and page interchangeably, I understand that you can't have different size pages in the same document.

             

            Thank you for your help.

             

            [FYI]

            I created a class that creates a document with most of the document settings that I use (e.g. a standard number of pages, non-facing pages, units in inches, etc.) but I don't specify a page size, that's something that varies between documents, so I figured I could just apply that after I have created the page. The problem is, when I try to create multiple documents it doesn't work. The script will create the first document using the default page size settings and I can't get it to change the page size, but then the next document will be created using the page size I tried to apply from the previous document that the script created. I am sure this is totally a coding error somewhere else. I will try to track it down. Just when I think I have this stuff figured out . . .

            • 3. Re: HOW TO: Change page size after page is created?
              Harbs. Level 6

              Make sure you are setting the DOCUMENT documentPreferences, and not the APPLICATION ones...

               

              Harbs

              • 4. Re: HOW TO: Change page size after page is created?
                lanejd Level 1

                GENIUS!

                 

                That was absolutely my problem. Thank you for saving me a lot of debugging time.

                 

                Thank you very much!