Hi,
What Radzmar is saying is that Paul's solution is available on this thread. Have a look here: Re: Saving Fillable Form as non-fillable PDF. Also on page 5 there are many discussions on how to get the script object and function to work.
Paul's solution does work, but as you say you can also try other routes.
Good luck,
Niall
Hi,
I would like to have that script to lock the form from further editing. My email ID is sudeepfranco@gmail.com, also please tell me how can I add a SAVE button at the bottom of the form and link the script to that buttong.
Many Thanks
Sudeep
Hi Paul,
Wow, this is a long thread--I haven't read all of it so forgive me if this has been answered.
What I would like is a way to "flatten" the form after it has been filled out, but before saving it, so that it can be re-opened and viewed either by iOS or the Mac PDF viewer. I guess that would involve transforming the XFA layer/content with the data into a regular non-editable PDF. I haven't been able to "print to PDF" because of security settings ("This PostScript file was created from an encrypted PDF file. Redistilling encrypted PDF is not permitted.").
If your script does this, please send it to: kingphysh@gmail.com
Or, explain how this is done, if I need something different.
Thanks,
Stephen
Hi Sudeep and Stephen,
Paul's solution is in this thread: Re: Saving Fillable Form as non-fillable PDF.
When you download it and open in LC Designer you will see that the lock button calls a function that is in a script object. There are a few screenshots and instructions in this thread as well: Re: Saving Fillable Form as non-fillable PDF.
The process does not change the type of PDF (it is still an XFA form), but works through all of the objects are sets their access property to readOnly.
The current version does not lock buttons, where their names begins with "Button". See the script in the function.
Hope that helps,
Niall
Thanks Niall,
I have used the access property successfully to make forms readOnly--not a big deal--been there, done that. In fact, I prefer to set the access property to "Protected" rather than readOnly. There seems to be differences in the ability to copy field data to the clipboard.
What my client demands is re-opening and viewing the filled-out form on his Mac WITHOUT Adobe Reader. He is an Adobe-phobe and doesn't want ANY Adobe programs on his precious Mac. So that means he wants to use the built-in PDF viewer or some other non-Adobe product to open the completed form and view the data. This is an objection I cannot overcome.
Taking sides in corporations' battles seems pointless to me--they all have their dark side--but that is a discussion for another day.
Thanks,
Stephen
Hi Stephen,
XFA forms on 3rd party viewers are a big problem. See here: http://assure.ly/hd4jFh.
You might be okay with a viewer, as long as there isn't script and they don't interact with the fields.
Niall
Okay having a bit of trouble with another form that I am working on.
So with this new form, I click my "save locked" button which I have a script at the end that saves my form, after it locks all of the fields. Well what happens is my form tries to save, then lock the fields. So the ending product is an unlocked form, which is a problem.
Also, I tried making a lock only button which after the fields are locked, a save-as button pops up. Well the lock button works, then the save-as button pops up and then after I click save, it looks like the buttons work. But when I re-open the form, it is all unlocked.
Anybody have any ideas? Im clueless as to what is going wrong! ![]()
Thanks in advanced!!!
Could you please send me the script for locking fields?
Send to: blatham@remax.net
Thank you in advance, this is awesome!
Paul you must be the man of the moment. That script will help me as well =)
msfuzzibear@hotmail.com if you have a spare moment =)
Many thanks
Hi,
I haven't had success printing my forms to PDF (with Acrobat). If you have put an Editing password on it, they won't print to PDF (because it is now "Secured"). That's my experience anyway. That's even if you allow printing in the Security section of the document properties. If there is a way, I'd sure like to know it.
Stephen
I would be very interested in this script that you have. So once it is locked, will I be able to save it like that? Please send it to brian@wickedcoollogo.com. Thanks in advance!
Now that my ability to add attachments to the forum has been restored I will attach it here.
Note that teh script will lockl the fields only ....the ability to save the file locally is done by Reader Extending the document from Acrobat or LiveCycle Reader Extensions server.
Paul
Paul i read this thread & i need the same thing (The script) you people are talking about here. i need it badly to fill some immigration forms.
My email ID: hnuniversal4u@gmail.com
it wll be a great help to me & i wl really appritiate that. Thanx Bro.
Another very simple (less advance) approach would be to make the ENTIRE form protected, readOnly, nonInteractive, etc. by using the following script:
xfa.form.form1.access = "protected";
In my situation (if this helps anyone), all I wanted to do was enable my user to click an email button to auto-attach a copy of his/her form to an outgoing email, BUT prior to sending the email, I wanted the form to be flattened (i.e. protected). After the email was sent, I wanted it return back to it's open state. So what I did was create a custom email submit button, and added very simple scripts for the preSubmit and postSubmit events. NOTE: This assumes your user is using an email client which will auto-generate an outgoing email (vs. using an Internet email service like GMAIL). If you're using an interent email service, the follwoing scripts will work.
1. Email button: This custom email button script allows me to set the subject, body message, to/cc fields, etc. and email the entire form (wth proper Rights) to a given recipient(s).
Placed on a standard button's click event:
var choice = xfa.host.messageBox("Press OK to submit this form using your default email client (e.g. Microsoft Outlook, Outlook Express, Eudora, Mail, etc.). Note: A copy of this form will be automatically attached to your email. \n\nPress Cancel if you currently use an Internet email service such as Gmail, Hotmail, or Yahoo to send email. You will need save this form on your computer and then manually attach it to an outgoing email (using your Internet email service) addressed to: sample@email.com", " ", 3, 1);
// Note: the above text was taken directly from the typical email submit button text. This gives you a way to modify the text if you want.
if (choice == 1){
var mail;
var address = "email@email.com";
var ccadd = ccAdd.rawValue; //taken from a field placed on the form
var sub = "Subject goes here";
var body = "See attatched file.";
mail = "mailto: " + address + "?cc=" + ccadd + "&subject=" + sub + "&body=" + body;
event.target.submitForm({
cURL: mail,
bEmpty: true,
cSubmitAs: "PDF",
cCharset: "utf-8"
});
}
else{
ProcessManager.terminateAction();
}
2. Script added to same email button (created above) to "Protect" ALL form fields PRIOR to the form being emailed. Place on preSubmit event:
xfa.form.form1.access = "protected";
3. Script added to same email button (created above) to "reopen" ALL form fields AFTER it the form has been submitted. Place on postSubmit event:
xfa.form.form1.access = "open";
From there, the user can save/SaveAs the original file (currently opened on-screen, with active fields), knowing that he's sent a protected copy. Please note that you've sent a "form" with protect fields...it's still a form, vs a truly "flattened copy". So if security is a major concern, you'd probably want to use a different approach: for example, a digital signature to track from integrity, or print to PDF. Also, this assumes you;re not concerned with tracking "mandatory fields" etc.
As an alternate Step 3, you could interject a SaveAs script on the postSubmit event [ app.execMenuItem("SaveAs") ] to allow your user to save a copy of the protected file somewhere on his/her computer after emailing it. Then he/she could simply cancel the current form (on-screen) - without saving it. This assumes you are not concerned with saving an "open field" version with completed data.
Hopes this helps someone!
S
Hi SI_MSD7 - Before I say anything, let me tell you that I dub my self as technologically challenged and barely understand half of IT speak so please bear with me...
What you posted is exactly what I need to do (if I understood the jargon correctly
). Allow me to explain what I need to happen just in case i misunderstood wha you posted... I have an already existing fillable form that needs to be sent via email filled out with details we require. The same form also needs to have an option to be saved and locked down (no editing or filling in allowed) under a different filename without compromising or changing the details of the pre-existing fillable form. They should also have the option to send it via their email opened in a browser (i.e. hotmail or gmail) or via an email client (i.e. thunderbird) to different email addresses. Now, I have acrobat x pro but my employees don't. They would only have the free version reader. Is this possible with the script you posted above? If so, (and here is where you have to excuse my IT dumbness
) how do I go about adding the script you mentioned?
My knowledge about PDFs is only limited converting docs to PDF and maybe an idea of how to create a fillable form but that's about it. I'm a noob when it comes to acrobat. I would appreciate any assistance you could offer. You can email me at hannahlacsonAThotmailDOTcom.
Thank you in advance for your help!!!
Hi hanlac,
First off, don't worry about your level of skill re: coding. I'm no programmer, myself, and that's what forums like these are for - given the fact that you are "somewhat" familiar with the form creation process and basic scripting (i.e. knowing where to place the script, etc.).
In either case, my first question is to ask what program was the form created in - Acrobat (aka an AcroForm) or LiveCycle Designer (LCD)? If you are unsure, open the file in Acrobat and select the Forms menu item. If the second option in the drop-down list says "Add or Edits Fields..." then the form is an AcroForm; if it says "edit in Designer..." then the form was originally created in LC Designer and you'll need to have that installed to be able to make any edits.
Quite honestly, if you don't have LCD already installed (which by the way comes packaged with Acrobat Pro) and the form was in fact designed in LCD, then I'm not sure what the item in the Form list will say.
In order to get started, you’ll need to know this piece of info as it will impact the type of scripting needed. There are variations between Acrobat javaScript and LCD javaScript.
I'll take this offline and follow-up by sending you an email at the address you specified.
Hi SI_MSD7 - Thanks for responding! I am very grateful to people like you who share your expertise in forums like this to help thousands of strangers around the world (I'm from the Philippines
).
On the forms menu it gives me the option to "Edit." The original form I have to work with already came with fillable fields and I just need to edit it and have it do what I mentioned. Quite frankly, I'm not sure where this was created.
Thanks,
H
Hi this is balaji from solve it corp.your post are really good.I got what I expected.But I am unable to view the scripts.By the way I am using "adobe acrobat pro", there I have only java scripts and Im using the trial version.Can anyone help me to get the scripts for locking the controls and saving the pdf in the "adobe acobat pro".Or is it difficult in using the trial version
North America
Europe, Middle East and Africa
Asia Pacific