1 person found this helpful
... 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.
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.
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 . . .
Make sure you are setting the DOCUMENT documentPreferences, and not the APPLICATION ones...
That was absolutely my problem. Thank you for saving me a lot of debugging time.
Thank you very much!