ByteScout PDF SDK - C# - Add File Attachment Annotation in PDF - ByteScout

ByteScout PDF SDK – C# – Add File Attachment Annotation in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – C# – Add File Attachment Annotation in PDF

How to add file attachment annotation in PDF in C# using ByteScout PDF SDK

The tutorial shows how to add file attachment annotation in PDF in C#

The coding tutorials are designed to help you test the features without need to write your own code. What is ByteScout PDF SDK? It is the SDK for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings. It can help you to add file attachment annotation in PDF in your C# application.

The SDK samples like this one below explain how to quickly make your application do add file attachment annotation in PDF in C# with the help of ByteScout PDF SDK. Just copy and paste the code into your C# application’s code and follow the instruction. Test C# sample code examples whether they respond your needs and requirements for the project.

Download free trial version of ByteScout PDF SDK from our website with this and other source code samples for C#.

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Program.cs
      
using System.Diagnostics; using Bytescout.PDF; namespace FileAttachmentAnnotationExample { /// <summary> /// This example demonstrates how to attach a file to PDF document. /// </summary> class Program { static void Main() { // Create new document Document pdfDocument = new Document(); pdfDocument.RegistrationName = "demo"; pdfDocument.RegistrationKey = "demo"; // Add page Page page = new Page(PaperFormat.A4); pdfDocument.Pages.Add(page); // Attach file FileAttachmentAnnotation 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 result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

sample_attachment.txt
      
sample_attachment.txt 1234567890 abcdefghijklmnopqrstuvwxyz

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Get ByteScout PDF SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next