←Select platform

CreatedOriginal Property

Summary

Creation date and time of the PDF document. This is optional.

Syntax
C#
C++/CLI
Java
Python
public string CreatedOriginal { get; set; } 
public String getCreatedOriginal(); 
public void setCreatedOriginal( 
   java.lang.String value 
); 
public: 
property String^ CreatedOriginal { 
   String^ get(); 
   void set (String^ value); 
} 
CreatedOriginal # get and set (PDFDocumentProperties) 

Property Value

The value of the string stored in the original file containing date and time the PDF document was created. This value may contain time zone information. If the file does not contain this information, the default value is an empty String object.

Remarks

LEADTOOLS converts this value to UTC and stores it in the Created property.

The value of the CreatedOriginal property follows the PDF specification and should be in one of the two following forms:

  1. D:YYYYMMDDHHmmSSOHH'mm'
  2. YYYYMMDDHHmmSSOHH'mm'

Where:
   YYYY is the year
   MM is the month (01-12)
   DD is the day (01–31)
   HH is the hour (00–23)
   mm is the minute (00–59)
   SS is the second (00–59)
   O indicates the start of the time zone information and can be Z, + or -
   If O is + or -, the HH and mm values that follow it are the absolute values of the offset in hours (00-23) and minutes (00-59). The apostrophe character (') that follows these values is mandatory

The D: prefix is recommended, but not mandatory. Therefore, the 1st form is most common.

Everything after the year is optional. If day and month are missing, they are assumed to be 1. If hour, month and seconds are missing, they are assumed to be zero

The OHH'mm' section contains time zone information. If missing, the time zone information is unknown. In other words, missing time zone information is not equivalent to UTC.

If present, the time zone information should have these 3 forms:

  1. Z (indicates UTC and there is no HH and mm after it)
  2. +HH'mm' (indicates UTC + HH hours mm minutes)
  3. -HH'mm' (indicates UTC - HH hours mm minutes)

The TimeZoneOffset helper method can be used to extract the time zone information from the value of this property.

Example

C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
using Leadtools.WinForms; 
 
 
 
public void TestPDFTime() 
{ 
   string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
   PDFFile pdfFile = new PDFFile(pdfFileName); 
   pdfFile.Load(); 
 
   PDFDocumentProperties properties = pdfFile.DocumentProperties; 
   Console.WriteLine("Created = {0}", properties.Created.ToString()); 
   Console.WriteLine("Modified = {0}", properties.Modified.ToString()); 
   Console.WriteLine("CreatedOriginal = {0}", properties.CreatedOriginal); 
   Console.WriteLine("ModifiedOriginal = {0}", properties.ModifiedOriginal); 
   Console.WriteLine("CreatedTimeZoneOffset = {0}", PDFDocumentProperties.TimeZoneOffset(properties.CreatedOriginal)); 
   Console.WriteLine("ModifiedTimeZoneOffset = {0}", PDFDocumentProperties.TimeZoneOffset(properties.ModifiedOriginal)); 
} 
 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.BufferedWriter; 
import java.io.Console; 
import java.io.File; 
import java.io.FileWriter; 
import java.io.IOException; 
import java.io.OutputStream; 
import java.io.OutputStreamWriter; 
import java.nio.Buffer; 
import java.nio.file.Files; 
import java.nio.file.Path; 
import java.nio.file.Paths; 
import java.nio.file.StandardOpenOption; 
import java.sql.Date; 
import java.text.SimpleDateFormat; 
import java.time.LocalDateTime; 
import java.util.ArrayList; 
import java.util.List; 
 
import javax.xml.validation.Schema; 
 
import org.apache.lucene.store.Directory; 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
import leadtools.pdf.*; 
import leadtools.svg.*; 
 
 
public void testPDFTimeExample() { 
 
   String LEAD_VARS_ImagesDir = "C:\\LEADTOOLS23\\Resources\\Images"; 
   String pdfFileName = combine(LEAD_VARS_ImagesDir, "Leadtools.pdf"); 
   PDFFile pdfFile = new PDFFile(pdfFileName); 
   pdfFile.load(); 
 
   PDFDocumentProperties properties = pdfFile.getDocumentProperties(); 
   System.out.println("Created = " + properties.getCreated().toString()); 
   System.out.println("Modified = " + properties.getModified().toString()); 
   System.out.println("CreatedOriginal = " + properties.getCreatedOriginal()); 
   System.out.println("ModifiedOriginal = " + properties.getModifiedOriginal()); 
   System.out.println("CreatedTimeZoneOffset = " + 
         PDFDocumentProperties.timeZoneOffset(properties.getCreatedOriginal())); 
   System.out.println("ModifiedTimeZoneOffset = " + 
         PDFDocumentProperties.timeZoneOffset(properties.getModifiedOriginal())); 
} 

Requirements

Target Platforms

See Also

PDFDocumentProperties Class

PDFDocumentProperties Members

PDFDocumentProperties.Created property

PDFDocumentProperties.TimeZoneOffset method

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.