Skip to main content
Participant
May 17, 2018 11:50 PM UTC
Question

How to remove red form field border for entire PDF on Document Will Print event?

I have a very large form where I have set the border color to red on multiple fields because they are important to check but may not be required. We're talking 100+ Fields some unique and some duplicated.

Now that I have finished making the form I am trying to determine the best way to make the red borders show up for users filling in the forms but not print when they print the forms.

I was hoping to work out a solution that would change all text fields, radio buttons, check boxes etc to transparent border using the strokeColor property like so from the DC SDK Documentation:

for ( var i=0; i < this.numFields; i++) {

    var fname = this.getNthFieldName(i);

    var f = this.getField(fname);

    if ( f.type == "text") f.strokeColor = color.transparent;

}

However this has not worked on the Document will print event.

I was trying to get the bare minimum to work too as worst case scenario I could just get every field with red borders individually and turn them transparent but this also failed:

function border(){

var f = this.getField("fieldname");

f.strokeColor = color.transparent;

}

// alternatively

this.getField("fieldname").strokeColor = color.transparent;

Any help would be really appreciated! Thank you!

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Bernd Alheit
Community Expert
Community Expert
May 18, 2018 5:10 AM UTC

What happens when you print the document? What happens when you use a other color?

Translate
Participant
May 18, 2018 3:23 PM UTC

The red border for the form fields remain on the document, same with any other color.

Translate
Bernd Alheit
Community Expert
Community Expert
May 18, 2018 3:58 PM UTC

This happens when you use a other color and not transparent?

Translate