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

auto-print a .pdf

kyoshiro81
Registered: Sep 7 2007
Posts: 4

I wrote a .js. When I open a .pdf from my hd the script works fine, but when I open a .pdf inside my browser it only works once. That means the first time the .pdf-file is being printed but also an empty acrobat reader frame (8.1) opens. When I repeat the printing of the file nothing happens. Even when I try the .pdf-file on my hd, the script doesn't work.
 
BUT:
 
When I wait just a few minutes the script works again, till I try to open a .pdf-file directly inside my browser again.
 
content of my .js-file:
 
xxx();
 
function xxx() {
app.beginPriv();
var n = app.activeDocs;
var d = n[0];
 
if (((d.info.subject).search("TEST")>-1) && ((d.info.author).search("123")>-1 )) {
d.print({bUI: false, bSilent: true, bShrinkToFit: true});
}
 
app.endPriv();
 
}
app.trustedFunction(xxx);
 
thx 4 any help!!!

My Product Information:
Reader 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Acrobat works very differently in a browser than it does stand-alone. There are some JavaScript functions that will not work in a browser. However, what you're describing sounds like a but. Have you contacted Adobe Support?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

kyoshiro81
Registered: Sep 7 2007
Posts: 4
I tried, but Adobe Support doesn't help by scripting problems. That's why I try to get help in the community.