command line Print Web page

Source: Internet
Author: User
Tags wkhtmltopdf

Printhtml Program: http://www.printhtml.com/download.php

Download the program from this, need dhtmled control support, need Dot.net 4.0 or 4.5

Printhtml.exe/? Can bring up help, note not/help or-help


The name of the printer, see what the machine has the name of the printer, and then the command line:

Printhtml.exe directurl= "http://www.baidu.com" printername= "Bullzip PDF Printer" header= "" footer= ""

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/8E/A7/wKioL1jIGTqiw6LDAAB1Zq9NG5I906.png-wh_500x0-wm_ 3-wmp_4-s_440934755.png "title=" QQ screenshot 20170315001835.png "alt=" Wkiol1jigtqiw6ldaab1zq9ng5i906.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8E/A7/wKioL1jIGSqAfAM3AABXcTUixY8495.png-wh_500x0-wm_ 3-wmp_4-s_3672336608.png "style=" Float:none, "title=" QQ screenshot 20170315002354.png "alt=" Wkiol1jigsqafam3aabxctuixy8495.png-wh_50 "/>


Add header and footer, because if you do not add these two parameters, the page header output "A few pages a few pages", the end of the page output URL address


Easy to use, accessories download printhtml and dhtmled two programs



Cups, their own pages, use this stuff to print out the layout will be messy, change another way, first convert HTML to PDF, and then print

With this tool: Wkhtmltopdf, official website: http://wkhtmltopdf.org/index.html

It's not deformed.


Then how to automatically print it, imagine a way:

First, the printer support network, preferably in the intranet access to the specified PC installation printer driver, with bat to execute at regular intervals;

If the server cannot access the IP of the printer, you can use a peanut wand to do a port mapping, this is a way, but also need to know the printer port, whether only with a TCP can, if so, theoretically feasible


After changing the wkhtmltopdf, you need to use this to print normally: http://www.biopdf.com/acrowrap/close_adobe_reader.php

Usage:

acrowrap.exe/acceptlicense/t "Pdf_file_name" ["Printer_name"] ["Printer_driver"] ["Printer_port"]


Did not seriously study why printhtml can not print the reason, print out the page is problematic


Well, the above wkhtmltopdf + acrowrap work together, put a test code:

C:CD "C:\Program files\wkhtmltopdf\bin" Pwdwkhtmltopdf.exe "http://localhost:8080/my/data/file.html" "D:\file.pdf" CD "C:\Program Files (x86) \biopdf\acrobat Wrapper" pwdacrowrap.exe/t "D:\file.pdf" "Bullzip PDF Printer" Pause


command line Print Web page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.