How to batch print a web page (HTML page) to PDF file and print PDF file to Windows Printer?

I downloaded your command line pdfprint.exe . I have a vbs script that reads a text file of URL addresses and opens a Internet Explorer window using the URL. I need this opened Internet Explorer window to be printed to either a pdf file that is saved or directly to the default printer. This print would be one more step added to my VBS script loop (see attached script and text file). That is reading the text file of URL's and opening the Internet Explorer with the URL and then printing to a saved pdf or to default printer. How do I do this with your software ? What is the syntax and how would that fit in my VBS Script loop?

Attached is the VBS script file:


DIM strText
Const ForReading = 1
Set objFSO = CreateObject _
Set objTextFile = objFSO.OpenTextFile _
    ("c:\scripts\maps2.txt", ForReading)
Do Until objTextFile.AtEndOfStream
    strText = objTextFile.ReadLine
    Wscript.Echo strText
    Set objExplorer = CreateObject("InternetExplorer.Application")
    ObjExplorer.Navigate strText
    objExplorer.ToolBar = 1
    objExplorer.StatusBar = 0
    objExplorer.Width = 1040
    objExplorer.Height = 720
    objExplorer.Left = 0
    objExplorer.Top = 0
    objExplorer.Visible = 1
'    C:\doc2pdf_com_trial\html2pdf.exe "" "c:\yahoo.pdf"
'    C:\Scripts\VeryPDF\pdfprint_cmd\pdfprint.exe "-$" "XXXXXXXXXXXXXXXXXXXX" -printermargins -raster2 -wtype 0 -wo 20 -printer \\rein-6cd8f74b68\PDFcamp Printer "C:\Scripts\VeryPDF\pdfprint_cmd\90000545.pdf" -wtext ""

Thanks for your message.

Your VBS code is not good, I suggest you may by following solution to convert a web page to PDF file, and print this PDF file at background,

1. You can download and install Document Converter (docPrint Pro v6.0) from following web page,

you can run following command line to convert a web page to PDF file,

"C:\Program Files (x86)\docPrint Pro v6.0\doc2pdf.exe" -i "" -o C:\output.pdf

If your web page is contain Flash or SVG or other dynamic contents, you can add "-l" parameter to do a delay before conversion,

"C:\Program Files (x86)\docPrint Pro v6.0\doc2pdf.exe" -l 10000 -i "" -o C:\output.pdf

2. After you get a PDF file, you can call pdfprint.exe to print this PDF file to target printer,

C:\Scripts\VeryPDF\pdfprint_cmd\pdfprint.exe "-$" "XXXXXXXXXXXXXXXXXXXX" -printermargins -raster2 -wtype 0 -wo 20 -printer \\YourPrinter "C:\Scripts\VeryPDF\pdfprint_cmd\90000545.pdf"

You can use shell() or CreateProcess() or exec() or system() or other similar functions to run above two command lines easily.


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!