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

"This document is trying to print." dialog in Reader 8.1.2

jschlight
Registered: Feb 6 2008
Posts: 4

Each day our software generates thousands of barcoded labels as PDF documents which are delivered through web browsers. The documents include embedded JavaScript that requests the PDF document be printed on the default printer.

Adobe Reader 8.1.2 has a new "feature" that pops a dialog box with the message "This document is trying to print. Do you want to allow this?". Previously, the labels would just print without interruption. This dialog is going to quickly become a significant impediment to our workflow if we can't disable it.

Is there any way, either through configuring Adobe Reader, or modifying the JavaScript we generate, to have the labels print as they did before without the dialog box?

pddesigner
Registered: Jul 9 2006
Posts: 858
To specifies the level of interaction between the user and the print job. The value of the print property can be set through the constants InteractionLevel Object.

The default is full.

Non-interactive printing can only be executed during batch, console, and menu events. Printing is made non-interactive by setting bUI to false when calling the Document object print method or by setting the interactive property to silent, for example,

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.silent;

Outside of batch, console, and menu events, the values of bUI and of interactive are ignored, and a print dialog box will always be presented.

Try this JavaScript:

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "Adobe PDF";
this.print(pp);

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

jschlight
Registered: Feb 6 2008
Posts: 4
I've replaced the previous JavaScript:

this.print({bUI:false,bSilent:false});

with the new JavaScript:

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
this.print(pp);

Under Adobe Reader 8.1.1, the label prints immediately upon display in the browser. But under Reader 8.1.2, the confirmation dialog appears.

The JavaScript is being stored as an OpenAction.

Is the dialog now appearing because the OpenAction is not a batch, console, or menu event? Is there any workaround to make it behave as it did before?
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
You've encountered a security enhancement made to 8.1.2. You'll need to make this a folder level JS file with a trusted Function in order for it to work:
sPrint = app.trustedFunction( function(bUI, bSilent){app.beginPriv();this.print(false, false)})

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

jschlight
Registered: Feb 6 2008
Posts: 4
Thank you pddesigner and lkassuba for your timley and helpful replies.

I've been able to determine that the solution from lkassuba works on our Mac development system. I took the code above, placed it in a file called print.js, placed the print.js file into the user folder, and modified the JavaScript generated by our application to call sPrint instead of this.print.

The great thing is that it also works through the browser plug-in. So we may be able to use this technique as the basis of a workaround.

I was able to determine the user folder on the Mac by entering app.getPath("user", "javascript"); into the Debugger Console in Acrobat Professional. However, since we have only Adobe Reader on Windows, I've not been able to determine the user folder there.

How can I determine the app and user folders on Windows?
ChrisFreeman
Registered: May 6 2007
Posts: 19
On a Windows machine:

app.getPath("user", "javascript");
/C/Documents and Settings/[b][i]userName[/i][/b]/Application Data/Adobe/Acrobat/8.0/JavaScripts

app.getPath("app", "javascript");
/C/Program Files/Adobe/Acrobat 8.0/Acrobat/JavaScripts
camo
Registered: Feb 24 2008
Posts: 4
I too am experiencing the situation where Acrobat and Acrobat Reader now prompt the form filler to allow the document to print.

I have tried using lkassuba's script for a trustedFunction in a js file, but now get the following error in the debugger...

this.print is not a function

I am calling the trustedFunction from a validation script I have against a pdf form created in LiveCycle Designer 8

I am new to Acrobat / LiveCycle Forms (and Javascript for that matter) and wonder if you can advise on what I have missed or alternative solutions.
Thanks in anticipation
camo
Registered: Feb 24 2008
Posts: 4
I think I have solved my own problem...

I used the following instead of this.print

var myDoc = event.target;
myDoc.print(false,false);

Still testing, but I think that works sufficiently well for my application
dklock
Registered: May 26 2008
Posts: 1
I have read all of the suggestions, but I don't know where to start? I know nothing about JS. What extesion to I use on the JS file (js)? Where to I put this file? We are using windows XP

Thanks,
Doug
ChrisFreeman
Registered: May 6 2007
Posts: 19
".js" is the proper extention. The JS files are placed in either the "user" or "app" directory listed above. JS files in the "user" directory are only seen by that user, JS files in the "app" directory are seen by all users. Scripts contained in either of these system folder directories are known as "folder-level" scripts. If the script were embedded inside a document, it would be a "document-level" script.

To learn more on JavaScript, please read the "JavaScript for Acrobat API Reference" for more details.
fattchris
Registered: Jun 16 2008
Posts: 1
This little piece of insight saved my life!! Thanks a bunch guys!

BTW, anyone interested in this sort of thing.... I can verify it works with Acrobat 8.1.2 with IE7 and Firefox 2 on Windows XP SP2
PhilipXue
Registered: Sep 4 2008
Posts: 1
I have another issue with the PDF auto print.

we have 2 environments: one is using http and anther is using https (SSL).

With adobe reader 8.12,
In the first environment (http), we can get the dialog box. then if click "Yes" we can get the PDF files printed.

But, when switch to https, we cannot even see the dialog box and there is no PDF printed.

Is there any extra setting/changes for https (SSL), some thing like SSL Certificate, Digital Signatures or CDS?

Many thanks!
dormouse
Registered: Sep 4 2008
Posts: 2
I have the 'This document is trying to print' dialog box since I have upgraded from Acrobat Reader 7.0 to 7.1. (using Windows XP)

I need to be able to reinstall version 7.0 but the lowest version on the Acrobat previous versions webpage is 7.1.

This dialog box is causing me a great deal of grief. Is there any way I can download version 7.0 or even reinstall it from the Windows XP installlation disc?

Alternatively, I have version 7.0 installed on my computer at home. Can I copy the folder onto the desktop of my work computer and double click on the setup file?

Thankyou for your help.
dormouse
Registered: Sep 4 2008
Posts: 2
jschlight wrote:
Each day our software generates thousands of barcoded labels as PDF documents which are delivered through web browsers. The documents include embedded JavaScript that requests the PDF document be printed on the default printer.Adobe Reader 8.1.2 has a new "feature" that pops a dialog box with the message "This document is trying to print. Do you want to allow this?". Previously, the labels would just print without interruption. This dialog is going to quickly become a significant impediment to our workflow if we can't disable it.

Is there any way, either through configuring Adobe Reader, or modifying the JavaScript we generate, to have the labels print as they did before without the dialog box?
I have Adobe Reader installed on my computer in order to view pdf files and more importantly to generate barcoded address labels on the Parcelforce website (UK). I do not have Acrobat full program installed.

I found that updating Acrobat Reader from 7.0.9 to 7.1.0 caused the 'Document is trying to print' dialog box to appear with every label generated. It was very frustrating. I have cured the problem by uninstalling version 7.1.0 and reinstalling version 7.0.9. This automatically installs the 7.0.9 add-on in Internet Explorer 7 by the way.

I have disabled the 'automatic search for critical updates'. This option can be found in the Edit menu under Preferences, Category:Updates.

I found previously that if Adobe found an update it would generate a dialog box that was more often than not hidden underneath other windows. I would then wonder why my labels would not print - it was because this dialog box was waiting for a response and I didnt even know it was there.

My main problem was finding version 7.0.9. Go to the www.adobe.com web page and click on the large rectangular button 'Get Acrobat Reader' situated at the top right of the page and go to http://www.adobe.com/products/acrobat/readstep2.php?promoid=BUIGO

Then click on the link 'Different language or operating system?'
http://www.adobe.com/products/acrobat/readstep2_allversions.php

If you are using Windows as I am, in order to get version 7.0.9 to show as an option you must choose 2000 SP2-SP3 or NT SP6 as the operating system.

If you just enter XP you will be fooled into thinking that version 7.1.0 is the earliest one on offer!

Alternatively you can download version 7.0.9 and a whole host of other versions from www.oldapps.com/acrobat_reader.htm.

I hope this helps. I am just surprised that this problem is only reported on this thread as occurring on updating to version 8 when I found it with 7.1.0.
jesudas
Registered: Nov 16 2008
Posts: 1
can any one please provide the complete code for folder level js and Document JS.
caramel1982
Registered: May 17 2009
Posts: 1
To be honest, I am happy for my acrobat reader. No problem at all. I hope I will continue using my acrobat without any problems.

[url=http://simulationpretimmobilier.net][color=#DEDFDF][u]Simulation pret immobilier[/u][/color][/url]
BruceCampbell
Registered: Mar 16 2010
Posts: 4
Hi all. I'm creating a print button to print an entire pdf document from any page (button is on each page). Need to print silently and without prompting.

I've created a file "sprint.js":
sPrint = app.trustedFunction(

function(bUI, bSilent){
app.beginPriv();
this.print(false, false)
}
)

This is in the app level javascript folder.

The command in the doc's javasript window is simply "sPrint();"

It prints the first page only, consistently. There is no printer dialog or prompt to allow printing, which is good, but it will only print the first page. And yes, it's a multi-page document (I actually double-checked)!
parekhn
Registered: Feb 25 2009
Posts: 10
I use xfa.host.print command in Adobe LiveCycle Designer.

xfa.host.print(0, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0)

You can find the details of this command here:
http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Adobe_LiveCycle_Designer_Help&file=001735.php
BruceCampbell
Registered: Mar 16 2010
Posts: 4
I don't have LiveCycle Designer - trying to do this just with Acrobat 9 Pro.
FlexWebTech
Registered: Apr 3 2010
Posts: 1
BruceCampbell wrote:
Hi all. I'm creating a print button to print an entire pdf document from any page (button is on each page). Need to print silently and without prompting.I've created a file "sprint.js":
sPrint = app.trustedFunction(


function(bUI, bSilent){
app.beginPriv();
this.print(false, false)
}
)


This is in the app level javascript folder.

The command in the doc's javasript window is simply "sPrint();"

It prints the first page only, consistently. There is no printer dialog or prompt to allow printing, which is good, but it will only print the first page. And yes, it's a multi-page document (I actually double-checked)!
I spent almost a whole day on the same problem. I found three problems. The function below addresses them and prints all the pages in the document.


sPrint = app.trustedFunction(
function(){
app.beginPriv();
this.print({bUI:false, bSilent:true, bShrinkToFit:false});
app.endPriv();
}
)


In your document the call JavaScript string is just
sPrint();

I hope this helps

Peter
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
Thanks for posting your solution Peter.

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.