title: Reset printer to the default one in Adobe Reader JavaScript API
body: <p>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.</p>
  
  <p>The printing code is as following:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>According to the <a href="http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf" rel="nofollow">JavaScript API Reference</a> (pages 314, 583), the <code>getPrintParams()</code> returns default print parameters and <code>pp.printerName</code> set to <code>''</code> (empty string) means default printer. I realized that none of that is true. Actually <code>getPrintParams()</code> returns last used parameters (not a new/default one) and <code>pp.printerName = ''</code> does not reset printer to the default one, instead it uses last chosen printer.</p>
  
  <p>Moreover the <code>PrintParams</code> object seems to be shared across different opened documents, so I cannot store the name of default printer (read from first call of <code>getPrintParams()</code>) 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.</p>
  
  <p>The behavior is consistent across different versions of Adobe Reader (9, 10, 11) and Foxit Reader.</p>
  
  <p>Please help, how to reset programmatically the printer to the default one?</p>