COM - Convert HTML File

Hi,
I have been able to follow the example scripts (TestPage2PDF) for the COM server supplied with the install to automate printing of a test page.
My question is does anyone have an example of how to change this from a test page to a html file that I can give a file path at runtime of the file to be converted to pdf?

Thanks & Regards,
Shane.

Hi,

I don’t have an example, but a possible solution might be to use a browser which is capable of printing HTML to a specific printer via COM or the command line. The printing or the source document itself usually isn’t handled by PDFCreator, but you can call PrintFileSwitchingPrinters(string path, bool allowDefaultPrinterSwitch) on the PDFCreator object and PDFCreator will attempt to print it to itself using your default application for printing this type of file. This however only works if the default application has properly registered “print”/“print to” shell verbs and commands. It might be easier to simply print the HTML through a browser which support command line or COM printing.

Best regards

Robin