Skip to main content
.NET Framework 4.5.2+

PdfFileAttachment.MimeType Property

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

Namespace: DevExpress.Pdf

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

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 (e.g., “text/plain”).

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");
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MimeType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also