PdfExportOptions.Attachments Property
Obtains a list of PDF file attachments.
Namespace: DevExpress.Docs.Presentation.Export
Assembly: DevExpress.Docs.Presentation.v25.1.dll
NuGet Package: DevExpress.Docs.Presentation
Declaration
Property Value
Type | Description |
---|---|
ICollection<Attachment> | A list of attached files. |
Example
The following code snippet attaches a PDF file to the exported presentation:
using DevExpress.Docs.Pdf;
using DevExpress.Docs.Presentation;
using DevExpress.Docs.Presentation.Export;
//...
using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\Presentation.pptx")))
{
var attachment = new Attachment();
attachment.Data = File.ReadAllBytes(@"C:\Documents\test.pdf");
attachment.Relationship = AttachmentRelationship.Supplement;
attachment.FileName = "attachment.pdf";
attachment.CreationDate = DateTime.Now;
attachment.Type = "application/pdf";
PdfExportOptions options = new PdfExportOptions();
options.Attachments.Add(attachment);
presentation.ExportToPdf(new FileStream("C:\\Documents\\Presentation.pdf", FileMode.Create, FileAccess.ReadWrite), options);
}
See Also