These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

insertPages() and privilege escalation inquiry

userdude
Registered: Mar 1 2007
Posts: 4

I would like to use Acrobat to distribute a listing of available documents and forms from our department, and when someone clicks on one of the links, it replaces the current page with a new page downloaded from a url (the client software will see a static PDF file); in this manner, I hope to keep document distribution somewhat simplified, while at the same time preventing downloading, saving, and printing of forms and docs that then become out of date, but never get updated to match our documents and forms. However, I get a security error ("NotAllowedError: Security settings prevent access to this property or method."), and the documentation refers to "batch, console and menu actions" that allows this type of action to work. However, these are not what I am looking for, though; batch is only pre-delivery, console seems worthless except for testing, and having a menu seems a little strange (and maybe counterintuitive for a document). Is there some way to escalate privileges for this action? Can I use PDF + JS to tackle this issue? Another answer to another question on this website mentioned that, even if Professional can manage to accomplish this type of escalation, Reader won't be able to manage this; is this correct? Using Acrobat 7.0.0 (Professional and Reader).

My Product Information:
Acrobat Pro 7.0.0, Windows
tedpadova
ExpertTeam
Registered: Dec 31 2005
Posts: 848
The security warning appears because in Acrobat 7 and above you can't change documents content for items such as replacing pages, deleting pages, etc. Adobe added the extra security to prevent files from changing content without the user being aware of the changes.

You can add a folder level JavaScript to add priviliges that permit document content from changing. However, you would need each user who uses the feature to copy your folder level script to the individual user's JavaScript folder inside the Acrobat folder. This may not be practicle for your purposes. If you think it will work for you, consult the JavaScript Specifications manual for more info on beginning and ending priviliges.

ted

The author of numerous books on Acrobat, Photoshop, Illustrator and the Adobe Creative Suite, and an international speaker on Adobe Acrobat, Ted Padova is a well-known PDF guru.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're going about this in completly the wrong way. Forget about the "insertPages". This function is for automating document modifications in Professional. It doesn't work on Reader and the only way to create a privileged context to run it in is with either a digital signature or script file on the user's system.

Do you really need to update the entire page, or just data on the page? If it's just data then you could use the "submitForm" function to acquire new data. This works in Reader and doesn't require any special privilege.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

userdude
Registered: Mar 1 2007
Posts: 4
Ted

I have thought about attachments and whether they might be useful (unless I distributed as an executable or zip/cab, I'm not sure how else I might propogate a file structure), but my issue with that is that it takes away from the original purpose (which was to distribute copies of our docs/forms that forces the users to get fresh copies as often as possible). I'm fairly new to PDF and Adobe, though, so it might work. Thank you for the suggestion, I will keep it in mind.

Thom

Once the meaning of "batch, console, menu" actions finally sunk in, I realized this was the case with insertPages(). It just so happens this would make a great tool for a doc/form distrobution... I wasn't really thinking too much of the return on submitting a form; is it possible to pass a pdf template this way? My issue with this would be that, for a couple different reasons, Excel is the layout software, PDF is produced, and then in Professional I am adding the interactive form fields. If I can't bring that background (form) image into the new PDF, I'm not sure this way is exactly right, as I would need to replicate the current form in (I suppose...?) JS and build the PDF form on response.

Thanks!
Jared