Print Page | Close Window

Automatic rotation of odd pages

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 17 Jun 2019 at 2:02am
Software Version: Web Wiz Forums 11.10 -

Topic: Automatic rotation of odd pages
Posted By: basiluk
Subject: Automatic rotation of odd pages
Date Posted: 17 May 2014 at 12:05pm
Could some kind person please supply me with the necessary code that I can use in Acrobat Pro XI that will allow the automatic rotation of odd pages please?

I have a Lexmark scanner that will do duplex, but insists on inverting the odd pages !

Thanks in advance!

Posted By: gkaiseril
Date Posted: 19 May 2014 at 4:56pm
You can run the following code from the JS console:
function RotatePages(nStart, nEnd, nRotate, nOddEven) {
nStart =  starting page;
var nEnd = number of last page zero based page numbering;
var nRotate = The amount of rotation that should be applied to the target pages. Can be 0, 90, 180, or 270. The default is 0;
nOddEven =  0 - odd, 1 - even,  3 = all;
var bRotate = true;
for(var i = nStart; i < nEnd; i++) {
if(nOddEven < 3) bRotate = (i % 2 == nOddEven); //test for odd or even page;
if(bRotate) {
// rotate i page only
nStart: i,
nEnd: i,
nRotate: nRotate
} // process bRotate;
} // end page loop;
return true;
} // end RotatePages function;
RotatePages(0, this.numPages -1, 180, 1); // rotate all even pages;

Posted By: Horndoggie
Date Posted: 19 May 2014 at 5:09pm
I thought that running optimize scanned PDF would do this.  Am I confused?


Posted By: gkaiseril
Date Posted: 19 May 2014 at 5:25pm
The scanner maybe scanning one page at a time and assembliing them expecting that the even page was rotated bu the poster did not rotate the page.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -