HTML2PDF-X Pilot – Sample program (VB Script)


Home       Download       Samples       Tutorials       Pricing       FAQ       History

 

Draw images and do simple transformations

' Create HTML2PDF instance: 
Set html2pdf_obj = CreateObject("html2pdfx.HTML2PDFX")
 
' Initiate engine: 
html2pdf_obj.StartHTMLEngine "demo", "demo" 
 
' Set PDF filename: 
html2pdf_obj.OutputFileName = "Images_sample.pdf" 
 
' Set page margins: 
html2pdf_obj.MarginLeft = 20 
html2pdf_obj.MarginRight = 20 
html2pdf_obj.MarginTop = 0 
html2pdf_obj.MarginBottom = 0 
 
html2pdf_obj.DocumentTitle = "Example images drawings" 
 
html2pdf_obj.BeginDoc 
 
html2pdf_obj.DrawText 200, 200, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 220, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 240, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 260, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 280, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 300, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 320, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 340, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 360, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 380, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawText 200, 400, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 0 
html2pdf_obj.DrawImage 200, 200, "image.png", 0.4, 0.4, 0 
 
html2pdf_obj.DrawText 200, 500, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 520, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 540, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 560, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 580, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 600, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 620, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 640, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 660, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 680, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawText 200, 700, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 0.5, 1, 0 
html2pdf_obj.DrawImage 200, 500, "image.png", 0.2, 0.4, 0 
 
html2pdf_obj.DrawText 600, 200, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 220, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 240, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 260, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 280, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 300, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 320, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 340, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 360, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 380, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawText 600, 400, 400, 100, "alignleft aligntop", "Sample text on the background of the image", 1, 1, 45 
html2pdf_obj.DrawImage 650, 200, "image.png", 0.4, 0.4, 45 
 
html2pdf_obj.PenWidth = 3 
html2pdf_obj.DrawRect 100, 100, 800, 650, 0 
html2pdf_obj.FontPointSize = 14 
html2pdf_obj.DrawText 100, 100, 800, 40, "aligncenter", "Images with transparency:", 1, 1, 0 
 
html2pdf_obj.DrawRect 100, 800, 800, 550, 0 
html2pdf_obj.FontPointSize = 14 
html2pdf_obj.DrawText 100, 800, 800, 40, "aligncenter", "Scaling and rotation:", 1, 1, 0 
html2pdf_obj.DrawImage 200, 900, "image2.bmp", 0.4, 0.4, 0 
html2pdf_obj.DrawImage 400, 900, "image2.bmp", 0.8, 0.4, 0 
html2pdf_obj.DrawImage 200, 1120, "image2.bmp", 0.2, 0.4, 0 
html2pdf_obj.DrawImage 450, 1120, "image2.bmp", 0.3, 0.3, 45 
html2pdf_obj.DrawImage 700, 1120, "image2.bmp", 0.4, 0.2, 45 
 
html2pdf_obj.EndDoc 
 
Set html2pdf_obj = nothing 
 
CreateObject("WScript.Shell").Run "Images_sample.pdf"

 

– HTML2PDF-X Pilot sample page –

 


Home       Download       Samples       Tutorials       Pricing       FAQ       History