Skip to main content
Participant
May 17, 2018
Question

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

  • May 17, 2018
  • 1 reply
  • 2979 views

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 has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
May 18, 2018

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

Participant
May 18, 2018

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

Bernd Alheit
Community Expert
Community Expert
May 18, 2018

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