Take the 2-minute tour ×

I need to modify the creationDate of my pdf created using iText.

For me is enough to remove the time information putting 00:00:00 from the date.

Is it possible to do during pdf creation with pdfWriter?

Thank you! Marco

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I got it.. It is simple! You can do it at generation time:

PdfDictionary info = writer.getInfo();
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
info.put(PdfName.CREATIONDATE, new PdfDate(cal));
info.put(PdfName.MODDATE, new PdfDate(cal));
share|improve this answer
add comment

Your Answer


