That tutorial was extremely helpful and I think I'm almost there. How do I reference the document object? I put the function in it's own .js file and added the Javascripts folder to the trusted folders part in the javascript preferences(not sure if that was actually necessary), now I can see in the console that it is reading the function from that file but I'm not sure how to reference the document object. I tried passing it in as:
trustedNewPage(document, pageNumber, pageRect)
then putting it in the function as:
trustedNewPage = app.trustedFunction(function (doc, pageNumber, pageRect) {
app.beginPriv();
doc.newPage(pageNumber, pageRect[2], pageRect[1]);
app.endPriv();
})
I know this is probably elementary but I've never worked with this type of thing before. Thanks in advance for your help!