Javascript for printing form fields only

Community Beginner ,
May 03, 2022 May 03, 2022

Copy link to clipboard

Copied

Howdy everyone!

I am making a PDF form that will allow us to print onto an already printed cardstock form. I need to have the form fields visible while we are filling in the form, but then I only want the form fields to print. I know there is an option to do this in the print menu, but I would like to be able to have a button on the PDF page that allows one click send to the printer. I currently have the below Javascript added to a button that allows the one-click-print, but need to figure out how to add the "print form fields only" as a Javascript...any ideas? Is this possible?

 

var pp = this.getPrintParams();pp.interactive = pp.constants.interactionLevel.automatic;pp.printerName = "THIS IS THE PRINTER NAME";this.print(pp);

TOPICS
Create PDFs , Edit and convert PDFs , General troubleshooting , PDF forms , Print and prepress

Views

78

Likes

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

correct answers 1 Correct answer

Adobe Community Professional , May 04, 2022 May 04, 2022

Add this line:

 

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "THIS IS THE PRINTER NAME";
pp.printContent = pp.constants.printContents.formFieldsOnly;
this.print(pp);

Likes

Translate

Translate
Adobe Community Professional ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

Use the property printContent for this. Details are in the Acrobat Javascript Reference.

Likes

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 Beginner ,
May 06, 2022 May 06, 2022

Copy link to clipboard

Copied

Thank you!

Likes

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
Adobe Community Professional ,
May 04, 2022 May 04, 2022

Copy link to clipboard

Copied

Add this line:

 

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "THIS IS THE PRINTER NAME";
pp.printContent = pp.constants.printContents.formFieldsOnly;
this.print(pp);

Likes

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 Beginner ,
May 06, 2022 May 06, 2022

Copy link to clipboard

Copied

LATEST

Perfect thank you so much!

Likes

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