Please upload your PDF somewhere and link to it.

If there is really a cross reference stream, then the error message is correct (and 2.0.29 is at fault), because that is a PDF 1.5 feature and PDF/A-1b is based on 1.4.

Tilman


On 20.09.2023 17:00, Morten Stulen wrote:
After upgrading to PDFBox 3, the PreflightParser.validate() function
returns an error.
"Trailer Syntax error, /XRef cross reference streams are not allowed"

Code:

fun isValid(bytes: ByteArray): Boolean {
   val fileName = "tmp_${UUID.randomUUID()}.pdf"
   val file = File(fileName)

   val document = Loader.loadPDF(bytes)
   document.save(fileName)

   // This returns a ValidationError
   val result = PreflightParser.validate(file)

    return result.isValid
}

The tested PDFs are the same as before the upgrade.



ᐧ



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to