Home Download Samples Tutorials Pricing FAQ History
HTML-to-PDF conversion
' Create HTML2PDF instance: Set html2pdf_obj = CreateObject("html2pdfx.HTML2PDFX") ' Initiate engine: html2pdf_obj.StartHTMLEngine "demo", "demo" ' Set PDF filename: html2pdf_obj.OutputFileName = "URL_to_PDF.pdf" ' Set page margins: html2pdf_obj.MarginLeft = 10 html2pdf_obj.MarginRight = 10 html2pdf_obj.MarginTop = 50 html2pdf_obj.MarginBottom = 50 html2pdf_obj.BeginDoc ' Rescale content to fit page: html2pdf_obj.ContentZoomFactor = 75 ' After PageTimeout (in sec) loading will stop and conversion will proceed ' with loaded content: html2pdf_obj.PageTimeout = 90 ' Define base URL for resolving relative links: html2pdf_obj.BaseURL = "https://www.colorpilot.com" ' Load URL: html2pdf_obj.LoadURL "https://www.colorpilot.com" ' Perform conversion: html2pdf_obj.ConvertAll html2pdf_obj.EndDoc Set html2pdf_obj = nothing CreateObject("WScript.Shell").Run "URL_to_PDF.pdf"
– HTML2PDF-X Pilot sample page –