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+

PdfFileAttachment.CreationDate Property

Gets or sets date when the file attachment was created in the document.

Namespace: DevExpress.Pdf

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

Declaration

public DateTimeOffset? CreationDate { get; set; }
Public Property CreationDate As DateTimeOffset?
public DateTimeOffset? CreationDate { get; set; }
Public Property CreationDate As DateTimeOffset?

Property Value

Type Description
Nullable<DateTimeOffset>

A nullable DateTimeOffset structure that is a valid date-time offset.

Property Value

Type Description
Nullable<DateTimeOffset>

A nullable DateTimeOffset structure that is a valid date-time offset.

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