Every ByteScout tool includes simple example VB.NET source codes that you can get here or in the folder with installed ByteScout product. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can add file attachment to pdf with pdf sdk in VB.NET.
The following code snippet for ByteScout Premium Suite works best when you need to quickly add file attachment to pdf with pdf sdk in your VB.NET application. Follow the instructions from scratch to work and copy the VB.NET code. If you want to use these VB.NET sample examples in one or many applications then they can be used easily.
ByteScout provides the free trial version of ByteScout Premium Suite along with the documentation and source code samples.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
Imports Bytescout.PDF
''' <summary>
''' This example demonstrates how to attach a file to PDF document.
''' </summary>
Class Program
Shared Sub Main()
' Create new document
Dim pdfDocument = New Document()
pdfDocument.RegistrationName = "demo"
pdfDocument.RegistrationKey = "demo"
' Add page
Dim page = New Page(PaperFormat.A4)
pdfDocument.Pages.Add(page)
' Attach file
Dim fileAttachment = New FileAttachmentAnnotation("sample_attachment.txt", 20, 20, 20, 20)
fileAttachment.Icon = FileAttachmentAnnotationIcon.Paperclip
page.Annotations.Add(fileAttachment)
' Instruct PDF viewer application to show attachments pane on startup
pdfDocument.PageMode = PageMode.Attachment
' Save document to file
pdfDocument.Save("result.pdf")
' Cleanup
pdfDocument.Dispose()
' Open document in default PDF viewer app
Process.Start("result.pdf")
End Sub
End Class
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
sample_attachment.txt
1234567890
abcdefghijklmnopqrstuvwxyz
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: