PdfFileAttachment.Data Property
Gets or sets the data of the attached file represented as a byte array.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v24.1.Core.dll
NuGet Package: DevExpress.Pdf.Core
Declaration
Property Value
Type | Description |
---|---|
Byte[] | The file content data represented as a byte array. |
Example
using DevExpress.Pdf;
using System;
using System.IO;
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
// Load a document.
processor.LoadDocument("..\\..\\Document.pdf");
// Attach a file to the PDF document.
processor.AttachFile(new PdfFileAttachment() {
CreationDate = DateTime.Now,
Description = "This is my attach file.",
FileName = "MyAttach.txt",
Data = File.ReadAllBytes("..\\..\\FileToAttach.txt")
});
// The attached document.
processor.SaveDocument("..\\..\\Result.pdf");
}
See Also