I don't understand why not simply save as a copy, as you did before? That's the best (and probably only) way of doing it.
About the not allowed errors: Adobe made the security restrictions much tougher in the last version of Acrobat. Unless you use an earlier version there's no way around it.
Apologies for the way I described that process. I did not mean to
suggest that it was as straight forward as a copy/paste.
The issue is that I need the saveAs process to be entirely hidden from
the user. If I do a straight saveAs to their existing document, they
are left with the new doc still open in Acrobat. I do not want this. I
want to leave them in the state at which they entered this process -
with their original doc open and unmodified.
Then you need to do a saveAs, then close the file and then re-open the
Thanks again for responding. I appreciate your time and expertise.
I've been thinking about that exact approach. I'm going to give it a
go shortly. My only concern is how smooth that process will be, but I
guess I'll find out!
You may use bCopy option set to true, by default it's false.
bCopy! This is exactly what I needed.
Unfortunately, I keep running into NotAllowedErrors, even when trying to do very simple stuff.
Which runs at application launch. It adds a button to the toolbar, which when pressed saves a copy of the open document to a network location. Pretty easy. I'm just trying to get it to open an existing PDF right after it's done so, and I am getting the NotAllowed Error.
I'm suprised to see that such a simple call is yielding that error. Might it be because it's being called from a toolbar button? It seems to me that opening a PDF should probably be pretty straight forward, and my difficulty suggests to me that I'm doing something incorrectly.
In order to do a saveAs, I had to write a trustedFunction and a trustPropigatorFunction as well (this too seems severe). I tried doing this for the app.openDoc call and I still got the errors.
Why would app.openDoc throw NotAllowedErrors? Could these method calls be made in a way where they are trusted by default?
Thanks for your thoughts. Apologies for my rudimentary understanding of security and Acrobat JS generally. I really appreciate your time.
openDoc shouldn't have as many security restrictions as saveAs... try running this same line from the console and see if that works.
If not, then maybe there's a problem with the code itself.
Thanks for your imformative tips. They are all helpful.