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 _
    ("Scripting.FileSystemObject")
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 "http://www.yahoo.com" "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 ""
Loop
+++++++++++++++++++++++++++++++

Thanks
Customer
----------------------------------------
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,

https://www.verypdf.com/app/document-converter/try-and-buy.html
https://www.verypdf.com/artprint/docprint_pro_setup.exe

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 "https://www.verypdf.com/" -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 "https://www.verypdf.com/" -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.

VeryPDF

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!