Skip to main content
.NET Framework 4.5.2+

PdfFileAttachment.Relationship Property

Gets or sets the relationship between the document and the attachment file.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v22.1.Core.dll

Declaration

public PdfAssociatedFileRelationship Relationship { get; set; }

Property Value

Type Description
PdfAssociatedFileRelationship

A PdfAssociatedFileRelationship enumeration value that specifies the relationship between the document and the attachment file.

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