Copy link to clipboard
Copied
Hi, I'm currently using..
if (this.numPages % 2) {
this.newPage();
}
..to add a blank to the end of odd numbered documents, this will add an 8.5"x11" page but I'd like to add an A4 insstead, is there a way to specify the page size added?
Copy link to clipboard
Copied
..instead, not "insstead"
Copy link to clipboard
Copied
You can specify width and height as parameters of newPage. Look at the documentation of newPage.
Copy link to clipboard
Copied
Use this:
this.newPage(11.6*72, 8.27*72);
Copy link to clipboard
Copied
"this.newPage(11.6*72, 8.27*72);"
This is not A4 size 😉
Use this instead:
this.newPage(this.numPages-1, 595,842)
Copy link to clipboard
Copied
That's more accurate, true...
Copy link to clipboard
Copied
.. many thanks for that, the size is much better but it's not adding to the end of the file, it adds to the beginning and oddly on occasion inserts between other pages. I'm not sure how to modify the script to position the inserted page last.
Copy link to clipboard
Copied
What script does you use?
Copy link to clipboard
Copied
Hi, I was using
if (this.numPages % 2) {
this.newPage();
}
which added to the end but was not A4, then Ive tried
this.newPage(this.numPages-1, 595,842)
..am I missing part of the script?
Copy link to clipboard
Copied
Hi, I have it to the end using
if (this.numPages % 2) {
this.newPage(11.62*72, 8.70*72);
}
is it just a case of tweaking (11.62*72, 8.70*72 to get an A4 size?
Copy link to clipboard
Copied
Try this one:
if (this.numPages % 2) {this.newPage(this.numPages-1, 595,842);}
Copy link to clipboard
Copied
..thanks for that, this adds a 297mm x 279.4mm to the back, I'm not sure what the relationship between 595,842 and 297x279 is, so I'm not sure how to tweak these figures to create an A4, 297mm x 210mm page.
Copy link to clipboard
Copied
Sorry, you must remove the "-1" to put the new page at the end of the document:
if (this.numPages % 2) {this.newPage(this.numPages, 595,842);}
A4 size is 21 cm x 29,7 cm, so 595 x 842 is the closest conversion when you need to enter dimensions in points.
Copy link to clipboard
Copied
..fab, I imagined this the case, many thanks for all your help with this.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now