Class PdfAttachment
Represents the attachments of the PDF document.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.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)
Declaration
public PdfAttachment(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Name of the file. |
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. |