I'm trying to implement a java pdf-a validator using PdfBox. The file I'm dealing with is a digital signed pdf (PADES). Either I use pdfbox or an online tool the result is:
PreflightDocument document = parser.getPreflightDocument();
document.validate();
1.1 : Header Syntax error, First line must match %PDF-1.\d
1.1 : Header Syntax error, Second line must begin with '%' followed by at least 4 bytes greater than 127
1.0 : Syntax error, Missing end of file marker '%%EOF'
But when I open the file with any reader it's format is indeed pdf-a. Having a look inside the pdf actually the first line isn't %PDF-1, or the last %%EOF. May because the pdf is signed. Could it be? And in case, how can I get over this kind of validation in signed pdf?
0ƒ;f *†H†÷
ƒ;V0ƒ;Q10
`†He
ƒ;‡=ƒ;‡8%PDF-1.4
%ÿÿÿÿ
1 0 obj
<<
...
....
.....
To notice the "%PDF-1.4" at the end of the 4th line