Skip to main content

PdfFileAttachment.MimeType Property

Gets or sets the MIME type (content type) of the attached file.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

Declaration

public string MimeType { get; set; }

Property Value

Type Description
String

A String that represents the MIME type of the attached file.

Remarks

Use the MimeType property to specify the MIME type of the attached file (for example, “text/plain”).

Example

View 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 attached file.",
        FileName = "MyAttach.txt",
        Data = File.ReadAllBytes("..\\..\\..\\FileToAttach.txt"),
        MimeType = "text/plain",
        Relationship = PdfAssociatedFileRelationship.Supplement,
    });

    // The attached document.
    processor.SaveDocument("..\\..\\Result.pdf");
}
See Also