• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
May 17, 2018 May 17, 2018

Copy link to clipboard

Copied

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!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2018 May 17, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

LATEST

Yes, for instance:

function blueborder(){

var f = this.getField("Consultant First Name");

f.strokeColor = color.blue;

}

Does not change the border to blue from red, or if it is set as no border to blue when the document prints.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines