Copy link to clipboard
Copied
I have a fillable PDF with a lot of drop down menus. How do you make the arrows disappear after they enter the value? Would like to not have it there when it is printed.
The user will be able to select a value and change their selection as usual. It will be completely transparent for them. You can achieve it by applying the following code under Tools - JavaScript - Set Document Actions - Will Print:
for (var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f==null) continue;
if (f.type=="combobox") f.readonly = true;
}
And this code under the Did Print event:
for (var i=0; i<this.numFields; i++) {
va
...
Copy link to clipboard
Copied
You can do so by making the field read-only. However, if you do that after they select a value they won't be able to change it, which is not ideal.
Instead, you can do so (using a script) in the document's Will Print event, and then undo it in the Did Print event.
Copy link to clipboard
Copied
So someone using Acrobat Reader DC would still be able to chose an item from the list, but after selecting an item from the drop down they can't change it without closing and opening the file back up again? Just trying to be sure I follow what you are saying. I am having the same issue with a form I created, but don't know how to write script so this is likely my best option, if it will work the way I think you have explained. We just don't want the arrow to print on the form after they chose an option from the list, but they do need to be able to select an item from the list. If they chose the wrong thing and need to change it, then if it has to be closed and re-opened we can make that adjustment so long as they CAN choose an item from the drop down in Acrobat Reader DC and it won't print the arrow.
Thank you!
When I test it on my adobe acrobat DC
Copy link to clipboard
Copied
The user will be able to select a value and change their selection as usual. It will be completely transparent for them. You can achieve it by applying the following code under Tools - JavaScript - Set Document Actions - Will Print:
for (var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f==null) continue;
if (f.type=="combobox") f.readonly = true;
}
And this code under the Did Print event:
for (var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f==null) continue;
if (f.type=="combobox") f.readonly = false;
}
Copy link to clipboard
Copied
Thank you SO much for your help. I was able to follow your instructions and get the script added for each of the print actions very easily, but unfortunately I was told it still printed with the arrows after I saved the file and sent it to the person to test it for me. Do I also need to check "Read Only" under the drop down field's properties?
Copy link to clipboard
Copied
No, you don't.
Did they actually print the file, or just checked the preview in the Print dialog?
Copy link to clipboard
Copied
They did actually print it, I asked them the same thing lol so they sent me a picture of it after printing and the arrow still shows up : (
Copy link to clipboard
Copied
Works fine for me... Are you sure they opened the file using Adobe Acrobat or Reader?
Can you share the file with us?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I used a virtual printer and it worked fine...
Copy link to clipboard
Copied
I was able to get it to print without the arrows by logging in to one of the store's computers that had issues and they thought it was opening in adobe but it was opening in MS Edge. I'm so incredibly grateful for your help on this, thank you so very much!!!
Copy link to clipboard
Copied
Side note: I tested the original file I had used before adding the script and when opened in adobe it also doesn't print with the arrows, so that's interesting bit : ) Had I just checked that in the first place I could have saved all the trouble. But thank you nonetheless!
Copy link to clipboard
Copied
What happens when you print the form?
Copy link to clipboard
Copied
I got an email from a different store that said it worked fine for them as well, I have two so far saying the arrows are printing for them so I'll have to see how they are printing it. The arrows never print for me but I assumed that was because I was using Pro DC not reader.
Copy link to clipboard
Copied
Thank you! Followed the instructions and printed it out and it worked perfectly.
Copy link to clipboard
Copied
Hi,
I have tried using your code and the Will Print script says syntax error line 2. Did Print is fine. I am a newbie to script and tried everything like writing again and whatever I knew. It's even giving error with blank line. I'm using Adobe Acrobat Pro 2021. Any solutions?
Copy link to clipboard
Copied
There are no errors in that code. Did you edit it in any way?
Copy link to clipboard
Copied
Awesome, thanks so much for this. And you're right, it must be opened in Acrobat (not Edge or whatever). Works great!
Copy link to clipboard
Copied
Is this only good for his form? I'm trying to do the same thing but it's still printing on my side.
Copy link to clipboard
Copied
No, it can be used in any file.
Copy link to clipboard
Copied
I used a virtual printer and it worked fine for me too.