How to print HTML to a specific printer by command line?

Question:I am writing a service on the local server side which will accept the printer name and other inputs from the UI application and print the html file to the desired network printer. It is not a desktop application. I have a processed html file which I am reading into a string and want its output sent to the desired printer. Do you guys have such software?


Answer:According to your needs, maybe you can have a free trial software VeryDOC HTMLPrint to Any Converter, which can be used to batch print html, mhtml files or Web URLs to Windows Printer, it is print the whole web page's content to Windows Printer without user interaction, you can use it to full control printer's capability by command line. During the using, if you have any question, please contact us as soon as possible. In the following part, I will show how to use it.

Step 1. Download and Install

  • Download HTMLPrint to Any Converter Command Line.
  • This software has been compressed to zip file for uploading and downloading fast. So after downloading, please extract it to some folder.  If you need to know more information, please refer to the homepage.
  • If you are familiar command line software, simply check the parameters saved in the readme.txt then you can know how to use it.

Step 2. Print HTML to specific printer

Usage: html2any.exe [options] <HTML/MHTML file or URL>


  • When you need to specify printer name and printing copies, please refer to the following template. Meanwhile, you can specify the paper size. PDFcamp Printer is an example of the printer name.
    html2any.exe -printer "PDFcamp Printer" -copies 3 -paper 9 C:\test.htm
    html2any.exe -printer "PDFcamp Printer" -paper "11x17in" C:\test.htm
    -printer <string>     : printer name to print
    -paper <string>       : set paper size to printer
    -copies <int>           : copies to print
    You can also use the virtual printer instead of real printer, by virtual printer you can use this software as file format conversion software. By the following command line, you can convert html to PDF by Adobe PDF virtual printer.
    html2any.exe -printer "Adobe PDF" -paper "215.9x279.4mm" C:\test.htm
  • When you need to prompt the user with the print dialog so they can change printer settings and/or select pages manually, please use parameter –prompt.
    html2any.exe -savedevmode C:\printer.dat -printer docPrint
  • When you need to restore printer settings, please use -savedevmode parameter
    html2any.exe -loaddevmode C:\printer.dat C:\test.htm

I can not list all the parameters here, if you need to know more, please check parameters and usage in the readme.txt. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!