Table of Contents

Class PdfAttachment

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents the attachments of the PDF document.

public class PdfAttachment : PdfEmbeddedFileSpecification
Inheritance
PdfAttachment
Inherited Members

Examples

//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create an attachment.
PdfAttachment attachment = new PdfAttachment("Input.txt");
attachment.Description = "Input.txt";
attachment.MimeType = "application/txt";
//Add the attachment to the document.
document.Attachments.Add(attachment);
//Save and close the PDF document.
document.Save("Output.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create an attachment.
Dim attachment As New PdfAttachment("Input.txt")
attachment.Description = "Input.txt"
attachment.MimeType = "application/txt"
'Add the attachment to the document.
document.Attachments.Add(attachment)
'Save and close the PDF document.
document.Save("Output.pdf")
document.Close(True)

Constructors

PdfAttachment(string, byte[])

public PdfAttachment(string fileName, byte[] data)

Parameters

fileName string

The name of the file to be attached.

data byte[]

The data to be attached as a file.

See Also

PdfAttachment(string, Stream)

public PdfAttachment(string fileName, Stream stream)

Parameters

fileName string

The name of the file to be attached.

stream Stream

The stream to be attached.

See Also

See Also