You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Julien Béti <ju...@beti.name> on 2015/01/21 12:31:16 UTC
PDFBox-generated PDF/A-1b not validated using PDFBox validation
Hello,
Attached, you'll find a sample java code which creates a PDF/A-1b file
using CreatePDFA sample [1], and then immediately tries to validate it
using Preflight as described in Cookbook [2]
The validation fails with the following error:
--8<----------------
The file/tmp/test.pdf is not valid, error(s) :
7.1 : Error on MetaData, xmp should start with a processing instruction
-->8----------------
I'm using PDFBox to generates PDF/A files which are validated by an
application which obviously uses PDFBox for validation, and my PDF
files are rejected for the moment, with the same error.
Could you please tell me what's missing in CreatePDFA sample to make
it pass the validation?
Kind Regards,
Julien.
[1]
http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdfa/CreatePDFA.java?revision=1620380&view=markup
[2] http://pdfbox.apache.org/1.8/cookbook/pdfavalidation.html
Re: PDFBox-generated PDF/A-1b not validated using PDFBox validation
Posted by Tilman Hausherr <TH...@t-online.de>.
epic fail :-(
I've opened
https://issues.apache.org/jira/browse/PDFBOX-2621
Tilman
Am 21.01.2015 um 12:31 schrieb Julien Béti:
> Hello,
>
> Attached, you'll find a sample java code which creates a PDF/A-1b file
> using CreatePDFA sample [1], and then immediately tries to validate it
> using Preflight as described in Cookbook [2]
>
> The validation fails with the following error:
> --8<----------------
> The file/tmp/test.pdf is not valid, error(s) :
> 7.1 : Error on MetaData, xmp should start with a processing instruction
> -->8----------------
>
> I'm using PDFBox to generates PDF/A files which are validated by an
> application which obviously uses PDFBox for validation, and my PDF
> files are rejected for the moment, with the same error.
>
> Could you please tell me what's missing in CreatePDFA sample to make
> it pass the validation?
>
> Kind Regards,
>
> Julien.
>
> [1]
> http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdfa/CreatePDFA.java?revision=1620380&view=markup
> [2] http://pdfbox.apache.org/1.8/cookbook/pdfavalidation.html
Re: PDFBox-generated PDF/A-1b not validated using PDFBox validation
Posted by Julien Béti <ju...@beti.name>.
I can confirm this solves the issue in my project too.
Thanks!
----- Message from Tilman Hausherr <TH...@t-online.de> ---------
Date: Wed, 21 Jan 2015 21:39:18 +0100
From: Tilman Hausherr <TH...@t-online.de>
Reply-To: users@pdfbox.apache.org
Subject: Re: PDFBox-generated PDF/A-1b not validated using PDFBox validation
To: users@pdfbox.apache.org
> Am 21.01.2015 um 12:31 schrieb Julien Béti:
>> serializer.serialize(xmp, baos, false);
>
> change "false" to "true", it should work then.
>
> Tilman
----- End message from Tilman Hausherr <TH...@t-online.de> -----
Re: PDFBox-generated PDF/A-1b not validated using PDFBox validation
Posted by Tilman Hausherr <TH...@t-online.de>.
I didn't test the file from your code, only the one from the example,
both with preflight and with
http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx
If you want to be really sure, when you continue with development, check
your files with the 2.0 version of the preflight app command line:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/preflight-app/2.0.0-SNAPSHOT/
because some of the improvements in preflight haven't been made to 1.8.
Tilman
Am 21.01.2015 um 21:39 schrieb Tilman Hausherr:
> Am 21.01.2015 um 12:31 schrieb Julien Béti:
>> serializer.serialize(xmp, baos, false);
>
> change "false" to "true", it should work then.
>
> Tilman
>
>
Re: PDFBox-generated PDF/A-1b not validated using PDFBox validation
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 21.01.2015 um 12:31 schrieb Julien Béti:
> serializer.serialize(xmp, baos, false);
change "false" to "true", it should work then.
Tilman