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

Is it possible to set form fields to only print when they're filled in?

New Here ,
Jul 29, 2019 Jul 29, 2019

I have sample text in my fields, which I don't want to print. But, if someone fills out the form, I do want their filled-in information to print. Is this possible to set up?

TOPICS
PDF forms
8.0K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Jul 29, 2019 Jul 29, 2019

OK, then you can use this code as the document's Will Print script:

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

    var f = this.getField(this.getNthFieldName(i));

    if (f==null) continue;

    if (f.type=="button") continue;

    if (f.valueAsString==f.defaultValue) f.display = display.noPrint;

    else f.display = display.visible;

}

View solution in original post

Translate
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 ,
Aug 12, 2019 Aug 12, 2019

The script works in Adobe Acrobat DC and Acrobat Reader DC. What app does you use?

Translate
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 ,
Aug 12, 2019 Aug 12, 2019

I'm using Acrobat DC and it still prints the title2 line.

Translate
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 ,
Aug 12, 2019 Aug 12, 2019

I can't see this line on the printout.

Have you enabled Javascript in the preferences of Acrobat?

Translate
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 ,
Aug 12, 2019 Aug 12, 2019

tenor.gif

Javascript is enabled and working.  Otherwise the name line would not be in all caps.

My printout still shows the Title2 line...

Translate
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 ,
Aug 13, 2019 Aug 13, 2019
LATEST

Post a screenshot of your printout.

Translate
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 ,
Aug 12, 2019 Aug 12, 2019

Works fine for me as well.

Translate
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