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

print pdf document with javascript

narutobaka
Registered: Oct 20 2008
Posts: 2

Hello,

I work on a lamp server.

I have generated a pdf document with fpdf library. I save it on my php server.

My problem is :

I want to know how can I print it with javascript without user intervention.

try this :

///////////////////////////////////////////////////////////////////////////////////////////////

function AutoPrintToPrinter()
{
//Imprime sur une imprimante partagée (requiert Acrobat 6 ou supérieur)
var server = 'my printserver name';
var printer = 'my print name';
var pp = getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.fileName="_state/monfichier.pdf";
pp.printerName = '\\\\\\\\'.server.'\\\\'.printer.;
print(pp);
//alert('hello world');
}

///////////////////////////////////////////////////////////////////////////////////////////////

I call this for my test with :

<?php
echo'

test d\'impression depuis un jscript

';
?>

///////////////////////////////////////////////////////////////////////////////////////////////

But I've some error with "var pp = getPrintParams();".

Can someone help me.

thank

++

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi narutobaka,

You can't do a silent print with JavaScript. Read this thread for a better explanation than I can give-

http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=15878

Hope this helps,

Dimitri
www.pdfscripting.com
www.windjack.com