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

Follow Up Question RE: JavaScript Trusted Function and Silent Print

jlogue
Registered: Jul 19 2009
Posts: 5
Answered

Hello,

There was a thread ( http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=12622 ) that helped me to successfully implement a silent print from a browser by adding a trusted function to a client Reader folder.

C:\Program Files\Adobe\Reader 9.0\Reader\Javascripts\print.js

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

This worked on my development machine, but when I tried to integrate the same trusted function on another machine I received the print confirmation dialogue box. Before I start ripping things apart for testing, I wanted to ask if there might be any reason why this would work on one machine and not another. My development machine has Reader 9.1.0 and 2 other machines I tested on had version 8 initially and I upgraded to 9.1.0. Upgrading did not resolve the issue.

I am calling this from some JS added using iText:

try { sPrint(false); } catch (e) { this.print(false); }

Any help on this would be appreciated.

Thanks!

My Product Information:
Reader 9.1, Windows
jlogue
Registered: Jul 19 2009
Posts: 5
Nevermind.

I figured this out... on the 2 machines that were not working, I had created the JS files manually from a text file... since the machines were configured to hide known file extensions - I saw "print.js" when the actual file name was "print.js.txt"

So, I guess I will just close this thread by saying thanks for the information Lori K. and "jschlight" - you helped me out with the information in that other thread :-)
try67
Expert
Registered: Oct 30 2008
Posts: 2399
Two comments:
- Why passing parameters to the function if anyway you're using hard-coded values (false, false) in your code?
- You should add app.endPriv(); at the end of the code.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com