Class PdfAttachment
Represents the attachments of the PDF document.
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfAttachment : PdfEmbeddedFileSpecification, IPdfWrapper
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[])
Declaration
public PdfAttachment(string fileName, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of the file to be attached. |
System.Byte[] | data | The data to be attached as a file. |
PdfAttachment(String, Stream)
Declaration
public PdfAttachment(string fileName, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of the file to be attached. |
System.IO.Stream | stream | The stream to be attached. |