Question:I have a PHP website in which the user can browse between documents. These documents are like PDF but converted into PNG files to make it work on mobiles. My question is, is there a way I can make a Printer dialog in PHP in which the user could choose the printings options that a "normal" printer dialog can offer then we can print image directly without converting it back to PDF? Is there any solution on VeryPDF?
Answer: When you need to print image directly to printer from VB or PHP, maybe you can have a free trial of this software: VeryPDF PDFPrint Command Line, by which we can print files of OpenOffice Documents, MS Word Documents, HTML Documents, vector drawing formats: .wmf, and .emf, image formats: .bmp, .jpg, .jpeg, .tif, .tiff, .gif, .png, and .pcx and so on so forth. Those functions only could be fulfilled by the latest version, if you use the older version, it will fails. Please check more information of this software on homepage, in the following part, I will show you how to use this software.
Step 1. Free download PDFPrint Command Line
- As this software is command line version, when downloading finishes you will find a zip file. Please extract it to some folder then you can use it normally.
- If you need to use the SDK version, there is also available.
Step 2. Print Image directly to printer from Visual Basic or PHP.
- Here is the usage for your reference:pdfprint.exe [options] [Options] <PDF Files>
- Here are some command line templates for your reference:
- When you need to call it from Visual Basic or PHP, please refer to the following code templates:
Print Raster Image formats:
pdfprint.exe C:\input.bmp
pdfprint.exe C:\input.jpg
pdfprint.exe C:\input.tif
pdfprint.exe C:\input.gif
pdfprint.exe C:\input.png
pdfprint.exe C:\input.pcx
pdfprint.exe C:\input.tga
pdfprint.exe C:\input.jp2
pdfprint.exe C:\input.j2k
pdfprint.exe C:\input.pnm
Sample: Visual Basic
Private Sub Command1_Click()
Dim nRet As Long
Dim strCmd As String
strCmd = "pdfprint -$ XXXXXXXXXXXXXXXXXXXX"
strCmd = strCmd & " -printer ""docPrint"""
strCmd = strCmd & " """ & App.Path & "\readme.pdf"""
MsgBox (strCmd)
nRet = VeryPDF_PDFPrint(strCmd)
MsgBox (Str(nRet))
End Sub
When you use this software, please note that not all the parameters are available when printing image files directly to printer. If you feel that you need to use some parameters of this software, you can use this software to convert image to PDF and then add those parameters. During the using, if you have any question, please contact us as soon as possible.