I am currently using the following code to convert an HTML document to PDF.
I am using a 3rd party PDF printer driver that is set as the default printer. The code above works great as it completes the entire process behind the scenes. However it requires that I have MS Word installed on the machine. Since all I am in need of is converting HTML, I am looking for a way to do this without using MS Word. I can automate InternetExplorer in a similar fashion but I am not aware of a method to print using the InternetExplorer object. Isn't there an easier way to simply convert an HTML document to PDF using FoxPro code ?
Any ideas would be greatly appreciated.
Todd
Code:
theFile = "myhtml.html"
pdfFile = "myhtml.pdf"
objWord = CreateObject("Word.Application")
objWord.DisplayAlerts = .F.
objWord.Visible = .F.
objWord.Documents.Open(theFile)
objWord.ActiveDocument.PrintOut(0,0,0,pdfFile)
objWord.Quit
objWord = .null.
Any ideas would be greatly appreciated.
Todd