I have to create a tool which adds to several .pdf file names their creation date. I'd like to use the creationdate stored internally in pdfs and for this I downloaded iText Community Edition.
Now, my code starts like this (VB)
Module Module1
Sub Main()
Dim filename As String = My.Application.CommandLineArgs(0)
Dim PDFReader = New Pdf.PdfReader(filename)
Dim PDFDocument = New Pdf.PdfDocument(PDFReader)
Dim documentinfo As Pdf.PdfDocumentInfo = PDFDocument.GetDocumentInfo
Dim author As String = documentinfo.GetAuthor
Dim creator As String = documentinfo.GetCreator
Dim mypdfobject = documentinfo.GetPdfObject
End Sub
End Module
I got the GetAuthor and GetCreator together with several other Get method, but I can't find something like GetCreationDate, only AddCreationDate.
If I go further into mypdfobject I find into map a /Creationdate tag, so I thought to use that, but, while it is often in the format D:20160704132234+02'00', sometimes I find something which seems binary data and I don't know how to decode that.
Is there any better way to get the creation date ?
Thanks
Stefano