Silently printing a PDF

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Silently printing a PDF

Postby idoctor » Sun May 02, 2004 10:12 am

I have used this method to silently print to acrobat reader. It prints the document with no user input. The method first writes a pdf stored in the database to a temporary file on the hardrive. Acrobat_location is the location of the .exe for acrobat reader and globals.Printer_Default is the name of the printer where you want to send the job.

// This will write the docuement to a temporary file
var tempFile = application.createTempFile('myFile','.pdf');
application.writeFile(tempFile,MediaFieldContainingthePDF);
// This silently prints the document
application.executeProgramInBackground('\"'+Acrobat_location+'\"', '/p', '/h', '/t',
'\"'+tempFile+'\"', globals.Printer_Default);

Thank Jan Block

John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Return to How To

Who is online

Users browsing this forum: No registered users and 13 guests

cron