Components for Developers
© 2000-2017, Two Pilots

PDF Library   EMF2PDF SDK Pilot   Virtual Printers   HTML2PDF-X Pilot   Converters   PDF Mosaic  
Home Download Samples Tutorials Pricing FAQ History

HTML2PDF-X Pilot

 

Sample program (VB Script).

' Create HTML2PDF instance:
Set html2pdf_obj = CreateObject("html2pdfx.HTML2PDFX")

' Initiate engine:
html2pdf_obj.StartHTMLEngine "demo", "demo"

' Set PDF filename:
html2pdf_obj.OutputFileName = "text.pdf"

' Set page margins:
html2pdf_obj.MarginLeft = 90
html2pdf_obj.MarginRight = 60
html2pdf_obj.MarginTop = 20
html2pdf_obj.MarginBottom = 50

html2pdf_obj.DocumentTitle = "Sample Drawing of Text"

html2pdf_obj.BeginDoc

html2pdf_obj.PageBackgroundColor = "green"

html2pdf_obj.FontFamily = "Lucida Handwriting"
html2pdf_obj.FontPointSize = 14
html2pdf_obj.DrawText 120, 50, 400, 30, "aligncenter", "The Little Prince", 1, 1, 0

html2pdf_obj.FontFamily = "Arial"
html2pdf_obj.FontStyle = "Normal"
html2pdf_obj.FontWeight = "Normal"
html2pdf_obj.FontPointSize = 5
html2pdf_obj.DrawText 120, 75, 400, 20, "aligncenter", "written and illustrated by", 1, 1, 0

html2pdf_obj.FontFamily = "Times"
html2pdf_obj.FontStyle = "Normal"
html2pdf_obj.FontWeight = "Normal"
html2pdf_obj.FontPointSize = 11
html2pdf_obj.DrawText 120, 90, 400, 30, "aligncenter", "Antoine de Saint Exupery", 1, 1, 0

html2pdf_obj.FontFamily = "Arial"
html2pdf_obj.FontStyle = "Normal"
html2pdf_obj.FontWeight = "Normal"
html2pdf_obj.FontPointSize = 4
html2pdf_obj.DrawText 120, 120, 400, 20, "aligncenter", "translated from the French\nby Katherine Woods", 1, 1, 0

html2pdf_obj.FontFamily = "Times"
html2pdf_obj.FontStyle = "Normal"
html2pdf_obj.FontWeight = "Normal"
html2pdf_obj.FontPointSize = 9
' html2pdf_obj.DrawRect 0, 100, 400, 170, 0
html2pdf_obj.DrawText 0, 170, 310, 130, "textwordwrap alignjustify", "In the book it said: ""Boa constrictors swallow their prey whole, without chewing it. After that they are not able to move, and they sleep through the six months that they need for digestion.""\n\nI pondered deeply, then, over the adventures of the jungle. And after some work with a colored pencil I succeeded in making my first drawing. My Drawing Number One. It looked something like this:", 1, 1, 0

html2pdf_obj.DrawImage 30, 310, "hat.jpg", 1, 1, 0
html2pdf_obj.DrawText 0, 410, 310, 220, "textwordwrap alignjustify", "I showed my masterpiece to the grown-ups, and asked them whether the drawing frightened them.\nBut they answered: ""Frighten? Why should any one be frightened by a hat?""\n\nMy drawing was not a picture of a hat. It was a picture of a boa constrictor digesting an elephant. But since the grown-ups were not able to understand it, I made another drawing: I drew the inside of a boa constrictor, so that the grown-ups could see it clearly. They always need to have things explained. My Drawing Number Two looked like this:", 1, 1, 0

html2pdf_obj.DrawImage 30, 580, "notahat.jpg", 1, 1, 0

html2pdf_obj.DrawText 0, 680, 310, 500, "textwordwrap alignjustify", "The grown-ups' response, this time, was to advise me to lay aside my drawings of boa constrictors, whether from the inside or the outside, and devote myself instead to geography, history, arithmetic, and grammar. That is why, at the age of six, I gave up what might have been a magnificent career as a painter. I had been disheartened by the failure of my Drawing Number One and my Drawing Number Two. Grown-ups never understand anything by themselves, and it is tiresome for children to be always and forever explaining things to them.\n\nSo then I chose another profession, and learned to pilot airplanes. I have flown a little over all parts of the world; and it is true that geography has been very useful to me. At a glance I can distinguish China from Arizona. If one gets lost in the night, such knowledge is valuable.\n\nIn the course of this life I have had a great many encounters with a great many people who have been concerned with matters of consequence. I have lived a great deal among grown-ups. I have seen them intimately, close at hand. And that hasn't much improved my opinion of them.", 1, 1, 0

html2pdf_obj.DrawImage 370, 175, "boa.jpg", 0.8, 0.8, 0

html2pdf_obj.DrawText 350, 340, 310, 500, "textwordwrap alignjustify", "Whenever I met one of them who seemed to me at all clear-sighted, I tried the experiment of showing him my Drawing Number One, which I have always kept. I would try to find out, so, if this was a person of true understanding. But, whoever it was, he, or she, would always say:\n\n""That is a hat.""\n\nThen I would never talk to that person about boa constrictors, or primeval forests, or stars. I would bring myself down to his level. I would talk to him about bridge, and golf, and politics, and neckties. And the grown-up would be greatly pleased to have met such a sensible man.", 1, 1, 0

html2pdf_obj.FontStyle = "Italic"
html2pdf_obj.DrawText 350, 310, 310, 500, "aligncenter", "***\nend of the first chapter...", 1, 1, 0

html2pdf_obj.DrawImage 390, 640, "prince.gif", 1, 1, 0

html2pdf_obj.EndDoc

Set html2pdf_obj = nothing

CreateObject("WScript.Shell").Run "text.pdf"

' MsgBox "Conversion finished!"

 

HTML2PDF-X Pilot sample page

Home Download Samples Tutorials Pricing FAQ History

 

PDF Library | EMF2PDF SDK Pilot | Virtual Printers
HTML2PDF-X Pilot | Converters | PDF Mosaic

Support | Blog
Contact | About | Site map

© 2000-2017, Two Pilots