These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Close print window programmatically

gomfp
Registered: Jan 31 2006
Posts: 14

Given a PDF form with a document level script (shown below) that opens the print window when the form first opens, is there anyway to possibly intercept or close the print window programmatically using a folder level script?

document level script in question:

pp = getPrintParams(); fv = pp.constants.flagValues; pp.flags |= (fv.suppressCenter | fv.suppressRotate | fv.setPageSize); this.print(pp);

Thank you ahead of time

My Product Information:
Acrobat Pro 8.1.7, Windows
eporlier
Registered: Jan 28 2010
Posts: 6
I guess that you could set bUI to false (1st parameter of print()
bUI: (optional) If true (the default), will cause a UI to be presented to the user to obtain printing information and confirm the action.
and bSilent to true (4th param of print()
bSilent: (optional) If true, suppresses the cancel dialog box while the document is printing. The default is false.
pp (in your ex.) being the last param (9th of print())
gomfp
Registered: Jan 31 2006
Posts: 14
I probably should have been more explicit in my initial post. Using the pp object won't work in this particular instance simply because the document level script that resides within the form cannot be directly accessed until the form is first open which in this case is a day late and a dollar short. The form in question denotes one of many generic PDF forms containing (2) UPS labels that my client receives from his merchant for shipping merchandise. Apparently someone thought it would be beneficial to implement a document level script that opens the print window whenever these forms are first opened to facilitate printing the labels. In this particular case, the positioning of the labels on the form do not accommodate my client's thermal printer. To address this issue, I added a tool button via a folder level script that rotates, splits, and crops the images ready for print to accommodate my client's printer. As such, my client doesn't need much less want a print window to popup each and every time he goes to open one of these PDF forms he receives from his merchant containing the UPS labels. Hence, if there was a method I could implement from inside a folder level script to close the print window when the form first opens, all would be resolved. Unfortunately, from everything I've researched thus far, I don't think this is possible. Hence my initial post to make sure that I haven't overlooked anything in attempting to resolve this matter.
gomfp
Registered: Jan 31 2006
Posts: 14
Upon further investigation, I found out that this cannot be done.