Is there a way to auto print the pdf file that was just generated ?
at the end of the code, I can use DrawToFile (NameOfTheFile.pdf)
then it will be displayed on the browser (IE) ... without clicking on the printer button of the PDF controls - can it be automatically printed (send to default printer) ?
Thanks,
Wendy
auto-print
Re: auto-print
Support · Jul 2, 2007Hello Wendy,
There is nothing built into our components to allow you to send a document directly to a printer. However in version 4.0 of our COM/ActiveX product there is support for document level javascript. Using this you could embed some javascript in the document so that as soon as it was opened (sent to the browser) the document would be sent directly to the printer.
Thanks,
ceTe Software Support Team
Re: auto-print
Forum member · Jul 2, 2007I just download the version 4.0
We create the pdf files dynamically (when we call the asp page that create that pdf file and save it as A.pdf) the name of the file is dynamically created as well. So could you give me hint how to have auto-print right after we save it to file (DrawToFile) and show it on the browser (DrawToWeb).
Thanks,
Wendy
Re: auto-print
Support · Jul 3, 2007Hello Wendy,
You will have to add the javascript to the PDF document using the AddDocumentJavaScript method. In orer to trigger the JavaScript you will have to open the PDF document on the browser or you have to open the saved PDF using the Acrobat. Following is the sample code to do this.
'Create document
Dim MyDocument
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
'Add page to the document
Dim MyPage
Set MyPage = MyDocument.AddPage()
'Add javascript to the document
MyDocument.AddDocumentJavaScript "print", "this.print({bUI: false, bSilent: true, bShrinkToFit: true});"
'Draw the PDF
MyDocument.DrawToWeb
Set MyPage = Nothing
Set MyDocument = Nothing
Thanks,
ceTe Software Support Team.