Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9300609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:49:13+00:00 2026-06-18T22:49:13+00:00

I have a PDF file with some scripting inside. The scripts are allowed to

  • 0

I have a PDF file with some scripting inside. The scripts are allowed to change the printer to which the document is being printed (because we have dedicated printer for barcodes and other printer for regular documents). The problem is, I have no idea how to reset the printer to the computer’s default one.

The printing code is as following:

var pp = getPrintParams(); // get printing parameters
pp.interactive = pp.constants.interactionLevel.automatic; // do not prompt user
pp.printerName = 'barcode_printer'; // set printer name
this.print(pp); // print

According to the JavaScript API Reference (pages 314, 583), the getPrintParams() returns default print parameters and pp.printerName set to '' (empty string) means default printer. I realized that none of that is true. Actually getPrintParams() returns last used parameters (not a new/default one) and pp.printerName = '' does not reset printer to the default one, instead it uses last chosen printer.

Moreover the PrintParams object seems to be shared across different opened documents, so I cannot store the name of default printer (read from first call of getPrintParams()) in some variable, because actually I don’t know if the read value refers to the default printer or it was already changed by other opened documents.

The behavior is consistent across different versions of Adobe Reader (9, 10, 11) and Foxit Reader.

Please help, how to reset programmatically the printer to the default one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:49:14+00:00Added an answer on June 18, 2026 at 10:49 pm

    Actually the problem can be worked around using the global object, which is shared across multiple opened documents in one instance of adobe reader.

    First time, the document is loaded, I check whether global object contains (my own) property defaultPrinter, unless that I call getPrintParams(), read the printerName field and assign it to the global.defaultPrinter. Then I can just read the field to obtain the default’s printer name. The code is as follwing:

    if (global.defaultPrinter === undefined) {
        global.defaultPrinter = getPrintParams().printerName;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some images and pdf file on my server which I use in
I have a huge pdf file (20 mb/800 pages) which contains some information. It
I have a transparent windows (skinnable). Inside, I'd like to preview some pdf file.
I have some binary data in memory (which represents a PDF file). What I’d
I have a pdf file with some table inside. I want to read this
I have some code to read from a pdf file. Is there a way
I have a pdf reader app which render the pdf file. It works fine
I have a controller which should generate pdf file and after that should redirect
I have a class which generates a pdf file. This class is extended by
I have a PDF file containing some tabular data. http://dl.dropbox.com/u/44235928/sample_rotate-0.pdf I have to extract

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.