When setting XMPSchemaBasic with in certain PDFs , setCreateDate and setModifyDate do not work if the dates are already set in the pdf.
So this will not work as expected:
Setting other metadata fields works as expected, except for these two.
I found a workaround . If I set the fields to null, before setting them to a new value everything works as expected:
But still it feels like there is something wrong with the way setting these two dates work.