A script to hide ruled lines
Copy link to clipboard
Copied
I want to make a single PDF that can either be printed out OR filled out as a form online.
when it is printed i want ruled lines for the end user to write on and when it is being filled out digitally i do not want the ruled lines.
i found a script in an old forum that should do exactly what i want but either i am using it wrong or it no longer works (old forum post)
here is the script that i found and tried to use...
This has been a long time issue with many of the forms I have done for my clients.In almost all cases, it boiled down to the question why there were those writing lines, and the conclusion was that the lines were here to help the user write in their text.
Now, if you fill out the form on screen, you don't need those guide lines at all, and the text is way more readable as well.
So, we came to the conclusion that when the form is filled out on screen, we don't need those lines, and we treat each of these fields with the following Format script:
if (event.value.toString().length > 0) {
event.target.fillColor = color.white ;
} else {
event.target.fillColor = color.transparent ;
}
So, if the field is empty, the lines will show through, and the form can be printed and filled out manually. If the field is not empty, the lines will be covered up, and we don't have to worry about them anymore.
can anybody let me know if the script no longer works or if i need a few tips on how to use it
Copy link to clipboard
Copied
The script will work.
Copy link to clipboard
Copied
It's meant to be used in a text field as validation script, you draw lines and then put text field over the lines, if you write something text field will have white background and lines will be invisible, if field is empty background is transparent and lines are visible.
Copy link to clipboard
Copied
Did you find a solution? I am in the same situation and found the same script. I can't get it to work and it is driving me bananas!!!

