Hi everybody,
I have a config.js located in the User Javascript Folder with:
--------------------------------------------
myTrustPropagatorDelete = app.trustPropagatorFunction(function(doc,nStart,nEnd) {
app.beginPriv();
doc.deletePages(nStart,nEnd);
app.endPriv();
})
myTrustedDelete = app.trustedFunction(function(doc,nStart,nEnd) {
app.beginPriv();
myTrustPropagatorDelete(doc,nStart,nEnd);
app.endPriv();
});
mySaveAs = app.trustPropagatorFunction(function(doc,path) {
app.beginPriv();
doc.saveAs(path);
app.endPriv();
})
myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path) {
app.beginPriv();
mySaveAs(doc,path);
app.endPriv();
});
--------------------------------------------
And then I have a button with:
--------------------------------------------
console.show();
myTrustedDelete(this,0,0);
// build file name
var myFileName = "LastName" + "FirstName" + ".pdf";
// add folder name
myFileName = "/c/Users/Cyan/Desktop/" + myFileName
myTrustedSpecialTaskFunc(this, myFileName);
--------------------------------------------
I have tested this without "Security Policy" and it works fine.
But when I apply "Security policy" with Compatibility: Acrobat 9.0 and later, Restrict Editing and Printing of a Document, Printing Allowed: High Resolution and Changes Allowed: Commenting, filling in forms fields and signing existing signature fields, it just throw me an error:
--------------------------------------------
RaiseError: This operation is not permitted.
Doc.deletePages:3:Field Button4:Focus
===> This operation is not permitted.
--------------------------------------------
Can I somehow make a "login" on the "Security Policy" or something so the document can be change and then "logout"?? Or what is I'm suppose to do?
Thanks in advance!!!
BTW: the trustPropagatorFunction doesn't do anything. Get rid of it.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script