Convert HTML file Into PDF File

Hi All

I have one File That is in .HTML Extension and I want to convert that file into PDF File. But I don’t Want open the file and click on save as PDF. Instead of doing that I want to convert it in background with invoke activity or any other activity. I also find one Code for that and try to put in invoke activity but still phasing some issue.

The code I have Used is :

'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = “/QtBinaries/”
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert HTML to PDF
Dim document As PdfDocument = htmlConverter.Convert(“”)
'Save the PDF document
'Close the document
'This will open the PDF file so, the result will be seen in default PDF viewer

Can you Please help guys
Thanks in advance

If u change .html to .pdf, u will not be able to open the file in pdf format.
Still if u want to go and save in pdf then use copy file activity and in the destination folder,u can mentione the file name as .pdf extension

@Sriharisai_Vasi Thanks for replying

Yes I know by changing the Extension only from.html to Pdf is not going to work . So I am trying to do with invoke code but phasing the mention issue.

Can you help me on that or any other better solution other than opening it and to ctrl+p and then save it as PDF.