Product: PDF SDK Java API
Product Version:Latest
Please give a brief summary of your issue: PDF annotation date is not setting properly
(Think of this as an email subject)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
I am using below code to convert my input date to PDFTron date and set it to PDF annotation date.
com.pdftron.pdf.Date pdfTronDate = new com.pdftron.pdf.Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
pdfTronDate.setYear((short) calendar.get(Calendar.YEAR));
pdfTronDate.setMonth((byte) calendar.get(Calendar.MONTH));
pdfTronDate.setDay((byte) calendar.get(Calendar.DAY_OF_MONTH));
pdfTronDate.setHour((byte) calendar.get(Calendar.HOUR_OF_DAY));
pdfTronDate.setMinute((byte) calendar.get(Calendar.MINUTE));
pdfTronDate.setSecond((byte) calendar.get(Calendar.SECOND));
return pdfTronDate;
Above code is setting incorrect date. For example if my input date is ā2021-06-25T22:46:40.814Zā then its setting as ā2021-06-25T6:46:40.814Zā to annotation.
Could you please provide a sample code on setting correct date to annotation.
Please provide a link to a minimal sample where the issue is reproducible: