0

I use itextsharp to watermark existing pdf files. For security reason I create a new pdf which is marked and if no error occurs I delete the old pdf.

But now the pdf didn't have the original creation date. Is it possible to modify the creation date manually?

I only found addCreationDate() to add the current date.

Best regards.

GermanSniper
  • 249
  • 1
  • 5
  • 19
  • No, we deliberately made it impossible to create PDFs with date and time that differs from the current date and time. What is the security reason that makes you create a new PDF instead of using `PdfStamper`? – Bruno Lowagie Jan 08 '15 at 12:28
  • *creation date* - do you mean *creation date* according to the file system information, or do you mean according to the PDF metadata? – mkl Jan 08 '15 at 12:28
  • here u can read why I create a copy und do not modify the source file: http://stackoverflow.com/questions/18253707/itextsharp-modify-existing-pdf-no-new-source-pdf-and-add-watermark – GermanSniper Jan 08 '15 at 12:37
  • @mkl: actually both but if I over think it's not possible. I should change my code to first make a copy and watermark the original source to keep creation date – GermanSniper Jan 08 '15 at 13:24
  • 1
    *actually both* - How do you add the watermark? If you do it using a `PdfStamper` the *PDF metadata creation date* (if present to start with) should not change. I have no good idea how to keep the *file system creation date*, perhaps you should simply set it again afterwards. – mkl Jan 08 '15 at 14:04

1 Answers1

1

The creation of a new PDF will contain the date of creation in the metadata. Using PDFStamper will manipulate the existing PDF and maintain the original creation date.