Getting error when converting htm to pdf and same error when converting same htm to tif
Public Function Convert2Tiff(ByVal In_HtmFilename As String, ByVal OutputFp As String) As Boolean
Try
Using document As HTMLDocument = New HTMLDocument(In_HtmFilename)
' Initialize ImageSaveOptions
Dim options = New Aspose.Html.Saving.ImageSaveOptions(Aspose.Html.Rendering.Image.ImageFormat.Tiff)
options.BackgroundColor = System.Drawing.Color.White
' Convert HTML to TIFF
Aspose.Html.Converters.Converter.ConvertHTML(document, options, OutputFp)
End Using
Convert2Tiff = True
Catch ex As Exception
MsgBox(String.Format("Error Converting to tiff : {0}", ex.Message), MsgBoxStyle.OkOnly, "Error")
Convert2Tiff = False
End Try
End Function
Public Function Convert2pdf(ByVal In_HtmFilename As String, ByVal OutputFp As String) As Boolean
Convert2pdf = False
Try
Using document As HTMLDocument = New HTMLDocument(In_HtmFilename)
' Initialize PdfSaveOptions
Dim options = New Aspose.Html.Saving.PdfSaveOptions()
options.BackgroundColor = System.Drawing.Color.White
' Convert HTML to PDF
Aspose.Html.Converters.Converter.ConvertHTML(document, options, OutputFp)
End Using
Convert2pdf = True
Catch ex As Exception
MsgBox(String.Format("Error Converting to PDF : {0}", ex.Message), MsgBoxStyle.OkOnly, "Error")
Convert2pdf = False
End Try
End Function