The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

PdfFileAttachment.MimeType Property

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

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v19.2.Core.dll

Declaration

public string MimeType { get; set; }
Public Property MimeType As String
public string MimeType { get; set; }
Public Property MimeType As String
public string MimeType { get; set; }
Public Property MimeType As String

Property Value

Type Description
String

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

Property Value

Type Description
String

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

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").

Examples

This example shows how to programmatically attach a file to the PDF document.

To do this:

using DevExpress.Pdf;
using System;
using System.IO;

namespace AttachFile {
    class Program {
        static void Main(string[] args) {

            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