Convert HTML to PDF | VB.NETByteScout PDF SDK

Convert HTML to PDF | VB.NET


Imports System.Drawing.Printing
Imports Bytescout.PDF.Converters

Module Module1

    Sub Main()

        Using converter As New HtmlToPdfConverter()

            converter.PageSize = PaperKind.A4
            converter.Orientation = PaperOrientation.Portrait
            converter.Footer = "FOOTER TEXT" ' optional footer text

            converter.ConvertHtmlToPdf("sample.html", "result.pdf")

            ' You can also pass a link instead of the input file:  
            'converter.ConvertHtmlToPdf("", "result.pdf")

        End Using

        ' Open result file in default PDF viewer

    End Sub

End Module