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

Is there a way to create a java script that would open up the print dialog and select black and white printing?

Explorer ,
Feb 09, 2017 Feb 09, 2017

In Acrobat X, is there a way to create a java script that would open up the print dialog and select black and white printing, and print the document? We have a color printer, and it is cheaper to print in B&W, and there is no color in the form being printed. We are currently changing it for this document every time we print it, we don't want to change the default because we do a lot of color as well. I'd like to assign the script to a button and add it to the form.

If there is a different way to accomplish this, I am open to suggestions.

Thanks in advance for any assistance.

TOPICS
Acrobat SDK and JavaScript , Windows
824
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

correct answers 1 Correct answer

Community Expert , Feb 09, 2017 Feb 09, 2017

Actually, it is possible to specify the color profile when printing, which can be used to print the document in gray-scale.

This code does that:

var pp = this.getPrintParams();

pp.colorProfile = "Gray Gamma 1.8";

this.print(pp);

Translate
Community Expert ,
Feb 09, 2017 Feb 09, 2017

I don't believe that's possible, no. What you can do, though, is use a

Preflight Profile to convert the file into grayscale before printing it,

but that might be a bit of an overkill...

On Thu, Feb 9, 2017 at 10:17 PM, robd64027506 <forums_noreply@adobe.com>

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 ,
Feb 09, 2017 Feb 09, 2017

Actually, it is possible to specify the color profile when printing, which can be used to print the document in gray-scale.

This code does that:

var pp = this.getPrintParams();

pp.colorProfile = "Gray Gamma 1.8";

this.print(pp);

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
Explorer ,
Feb 10, 2017 Feb 10, 2017

Thank you, I appreciate the replies.

My problem is not printing in grey scale, the file is B&W already, but it still registers as a color print on the printer, unless we actively change it in the printers dialog box. I want to select the printers B&W profile so that it doesn't use the color toner to print in grey scale.

I was hoping there was a way to open up the print dialog and have it go to settings and select to print in black and white from the options there. I'm sure there is a separate macro recorder program that would do it, but I wanted to accomplish this without installing a another app.

I will try your suggestion, and see if it registers as a color or B&W print when I send it to the printer. Thanks again!

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 ,
Feb 10, 2017 Feb 10, 2017

No, that's not possible.

However, if you could install an additional version of your printer and set it as B&W by default then it would be possible to specify that printer as the default one selected when opening the print dialog, using a script.

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
Explorer ,
Feb 10, 2017 Feb 10, 2017
LATEST

That's an interesting idea, however I just tested your script, and even when the dialog box says it's printing in color, it registers on the printer as a B&W print. Which was the goal, so thanks for that.

Now for the other programs, I might try your new suggestion!

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