-
1. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 9:10 AM (in response to alexander656)So I would like to user to press a button "save pdf"so they can save it locally in PDF format but with all form fields locked and shown as they put their input to the fields.
-
2. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 9:22 AM (in response to alexander656)And if a button is not possible, but I hope it is, the user himself can save the PDF but with read only fields. It;s also fine.
The important thing is that the interactive form that is made up by the user can be saved as a read only PDF.
Alternatively, if some fields are read only and some can be re-edited that's also fine.
Hope someone can help. But please explain in a step by step guide since I am not a programmer and not experienced in these things.
-
3. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 7, 2014 9:48 AM (in response to alexander656)You can use a script to set some, or all, of the fields in the file as read-only.
-
4. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 1:18 PM (in response to Gilad D (try67))Thank you, but can you give me the script?
Let's say I want to do it the most simple way.So the following
1) Let users upload an image (logo) in a PDF preferably that I can set the maximum dimensions of the image.
2) Let users fill in text form fields (this I managed to do)
3) Let users save the PDF as a normal PDF without the form fields active.
What scripts do I need?
Thank you!
-
5. Re: Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 7, 2014 1:22 PM (in response to alexander656)This code will set all the fields in the file as read-only:
for (var i=0; i<this.numFields; i++) { var f = this.getField(this.getNthFieldName(i)); if (f==null) continue; f.readonly = true; } -
6. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 1:37 PM (in response to Gilad D (try67))Thank you, so I have to create a "button"in Acrobat Pro and use this as a javascript item?
Or does it work differently?
Thanks Gilad!
-
7. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 7, 2014 1:46 PM (in response to alexander656)Yes, you can attach this code to a button that you create in Acrobat.
On Sat, Jun 7, 2014 at 10:37 PM, alexander656 <forums_noreply@adobe.com>
-
9. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 7, 2014 2:16 PM (in response to alexander656)Why are you setting the button as read-only?
On Sat, Jun 7, 2014 at 11:01 PM, alexander656 <forums_noreply@adobe.com>
-
10. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 2:18 PM (in response to alexander656)So basically I want a "save as"dialog to open that the pdf can be saved, but then with all fields as read only in the saved pdf.
If it is not possible to get a "save as"dialog box, people must be able to "save as" from the file menu but only in "read only" after they filled in the form.
-
11. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 2:19 PM (in response to Gilad D (try67))ah, Gilad, see my last remark/comment.
Thank you so much.
-
12. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 7, 2014 2:23 PM (in response to alexander656)Your reply doesn't really answer my question why you set this button as
read-only? A read-only button can't be clicked... Maybe you executed the
script once and then it became read-only?
Anyway, to open the Save As dialog you can add this code to the code I
provided earlier:
app.execMenuItem("SaveAs")
On Sat, Jun 7, 2014 at 11:19 PM, alexander656 <forums_noreply@adobe.com>
-
13. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 2:32 PM (in response to Gilad D (try67))I am sorry, I am not experienced in Adobe.
But Ok, now I use this code, which indeed, opens up a "save as"dialog box, really cool.
(so I placed the code below in a button)
app.execMenuItem("SaveAs")
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
f.readonly = true;
}
But when I save the file via the dialog box and I re-open the file, to see how it is saved, I can still edit all form fields, even if I just open it not in "form mode"
So that's not what I wanted. I want people to fill in the form, then press this "save as button" it saves the PDF with all form fields read only so you actually have a normal PDF you can print and not edit.
Hope you can help me out. I am going to bed now. Almost midnight here..
I continue to try tomorrow, hope you can help me out.
Greetings,
-
14. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 7, 2014 2:59 PM (in response to alexander656)You need to place the Save As call after the code that sets the fields as
read-only...
On Sat, Jun 7, 2014 at 11:32 PM, alexander656 <forums_noreply@adobe.com>
-
15. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 7, 2014 9:37 PM (in response to Gilad D (try67))Great! For all others that have this problem, I copy paste the code that works (because now it works) below. Thanks to Gilad this code below is working.
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
f.readonly = true;
}
app.execMenuItem("SaveAs")
One other question , I did not realise. So now I have this button at my form, the save as button. Perfect. But when people save the form, and it is non editable etc. And they open it again, they see the "save as" button. But since at that moment the PDF is non editable, how can I make it in such a way that after saving the "save as" button is removed from the PDF?
-
16. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 8, 2014 1:45 AM (in response to alexander656)Add this at the end of the code:
event.target.display = display.hidden;
-
17. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 8, 2014 2:41 AM (in response to Gilad D (try67))Great Gilad! Goodmorning.
Ok, so I have another question and hopefully the last one.
I have "text fields" in the form.
For example a field called : enter your name
What I want is that "enter your name" is pre-filled in the form field, but that users can alter it.
The idea is that they can "translate" from English in to their own language "enter your name"
Is something like that possible?
-
18. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 8, 2014 6:59 AM (in response to Gilad D (try67))Mm is it possible that the complete button now dissapears, even if I did not use it?
-
19. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 8, 2014 7:01 AM (in response to alexander656)I don't follow.
And your other question was answered many times of these forums. Try searching around a bit...
-
20. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
alexander656 Jun 8, 2014 7:06 AM (in response to Gilad D (try67))Yes, because I did not want to stalk you with to many questions I posted it as a new item (also because it actually is a new item/question).
Well bottom line is, is this then the right code to use?
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
f.readonly = true;
}
app.execMenuItem("SaveAs")
event.target.display = display.hidden;
-
21. Re: Interactive form. Upload PDF/JPEG but save PDF as normal not interactive PDF. How to do so?
Gilad D (try67) Jun 8, 2014 10:23 AM (in response to alexander656)Well, assuming you want the saved file to have the button hidden you should
actually place the new line just before the call to execMenuItem ...
On Sun, Jun 8, 2014 at 4:06 PM, alexander656 <forums_noreply@adobe.com>






