Use javascript to automate rotating a background image in Adobe Acrobat 2017?
Hi all. I have Adobe Acrobat 2017 and I am new to running actions but trying to learn. I have a pdf where the background image is sourced from a file and I need to rotate the image 270 degrees for the landscape pages only. I'd like to use javascript to automate this process. I found code to step through the document and find the landscape pages, but I can't figure out how to reference and rotate the background image. Can someone help?
/* Finds all landscape pages in current document */
var LandscapePageCount = 0;
{
for (PageIndex = 0; PageIndex <= this.numPages - 1; PageIndex++)
{
// check if this page is landscape or portrait
var aRect = this.getPageBox("Media",PageIndex);
var PageWidth = aRect[2] - aRect[0];
var PageHeight = aRect[1] - aRect[3];
if (PageHeight < PageWidth) // Landscape page found
{
LandscapePageCount++;
// NEED HELP HERE
}
}
app.alert("Total number of landscape pages found: " + LandscapePageCount, 3);
}
