SelectPdf for .NET - Pdf Portfolio - VB.NET / ASP.NET Sample

This sample shows how to use SelectPdf Library for .NET to create a PDF portfolio, add some embedded files to it and set some view settings.

These are the files that will be added to the pdf portfolio:
Test PDF document
Test HTML document
Test image file

Click on the "Create PDF" button below to see the result.

Sample Code Vb.Net

Public Class pdf_portfolio
    Inherits System.Web.UI.Page

    Protected Sub BtnCreatePdf_Click(sender As Object, e As EventArgs)
        ' the test files
        Dim filePdf As String = Server.MapPath("~/files/doc.pdf")
        Dim fileHtml As String = Server.MapPath("~/files/document.html")
        Dim fileImage As String = Server.MapPath("~/files/logo.png")

        ' instantiate the pdf portfolio manager
        Dim portfolio As New PdfPortfolioManager()

        ' add files to the portfolio
        Dim pdfFilePdf As New PdfPortfolioFile(filePdf)
        pdfFilePdf.Description = "PDF document"

        Dim pdfFileHtml As New PdfPortfolioFile(fileHtml)
        pdfFileHtml.Description = "HTML document"

        Dim pdfFileImage As New PdfPortfolioFile(fileImage)
        pdfFileImage.Description = "Image file"

        ' set view mode
        portfolio.ViewMode = PdfPortfolioViewMode.Details

        ' set startup file
        portfolio.StartupFileName = "logo.png"

        ' save pdf document
        portfolio.Save(Response, False, "Sample.pdf")

        ' close pdf document

    End Sub

End Class