itext-java
itext-java copied to clipboard
Actually sign the pdfa document as pdfa
Commit 4b6c5c36a32c1fddef7cde569f5cb82f2e804f2f added ability to sign the document as pdfa if the source document is pdfa. However, this change had no effect, because reader.getPdfAConformanceLevel() always returns null if associated PdfDocument is not opened. So all documents were signed as pdf.
Problem can be observed by adding a breakpoint in PdfSigner.initDocument() and running PdfASigningTest.java.
Test "PdfASigningTest" passes before and after my change. I have no idea how to modify this test so it would actually test that "return new PdfADocument(reader, writer, properties);" part was executed and not "return new PdfDocument(reader, writer, properties);".