Knowledgebase: Developer
Print PDF to paper printer
Posted by Craig Lebakken on 23 May 2008 02:04 PM
Question:
How do I send the PDF to a paper printer after the final PDF is created?

Solution:
Win2PDF can automatically print the final PDF to the Windows default printer if you set the "Print PDF" option in the "file options" setting as described at the following page:

http://www.win2pdf.com/doc/controllingencryptionandema.htm

You could also try the Windows "ShellExecute" API to print the SNP files using the "PRINTTO" verb using the "myPrintFile" routine in the following code:

Public Const SW_SHOWMINIMIZED = 2

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub myPrintFile(strFile As String, strPrinterName As String)
Dim PrinterName As String
If (Len(strPrinterName) > 0) Then

strPrinterName = "\""" + strPrinterName + "\"""

ShellExecute 0, "printto", strFile, strPrinterName, 0, SW_SHOWMINIMIZED
End If
End Sub

This code will print the PDF file to the specified printer using the default PDF viewer (usually Adobe Reader).
(0 vote(s))
Helpful
Not helpful

Comments (0)

Copyright 2000-2018 © Dane Prairie Systems LLC. All Rights Reserved. About Us | Privacy Policy | PDF Blog | Site Map