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

Removing javascript from a doc

Anonymous
Answered

I have an automatic invoice number that is generated by a script at document level. For example, when the document is opened the number displays 1001, 1002 etc. This works brilliant with the staff. The problem i have is that say i am working on the file and the invoice number displays 1001, our records here will say that form to that customer is 1001, but when the customer recieves it via email and open it, it will then display 1002, which is a recipe for disaster!

I am looking for this easiest way do disable javascript for the entire document just before i send it to the customer. I have a button that when i press, it sends the form to a customer from a hidden email field in the pdf, with the invoice number as the subject header and also displays an email message. What i was hoping for is a line of script that removes javascript in the document to place in my email button script or some advice on how to get round this. Or maybe even flatten just that form field.

I've got a few workrounds but don't really like them, one is remove the invoice script altogether and place in another pdf to generate a number, or use the fix-up panel, but don't like that method tho as it asks you to save the file which is not necessary in the workflow that i'm working on!

Any help would be greatly appreciated.

Cheers

My Product Information:
Acrobat Pro 9.1.3, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You can use the 'addScript()' method to overwrite the document level script that adds the invoice number. You cold overwrite it with a copy of the script but the code that adds the serial number is commented out.

George Kaiser