openoereb / pyramid_oereb_mfp

Implementation of a static extract (PDF export) for the pyramid_oereb server with MapFish-Print
1 stars 3 forks source link

PDF not compatible with PDF/A-1a #123

Open peterschaer opened 1 year ago

peterschaer commented 1 year ago

It seems that the PDFs created by pyramid_oereb_mfp are not compatible with PDF/A-1A. Other pyramid_oereb_mfp cantons also seem to be affected - as can be seen here and here.

When I validate some of our PDFs with VeraPDF, I get the following two errors with our PDFs: image

I have attached the PDF and the validation report. In our case, two errors are found: 20230203123527_extract.pdf Validation Report.pdf

I was able to narrow down the annotation error to the hyperlinks. In the other error, the ICC profile seems to be incompatible. Since I have too little knowledge of mapfish_print and Jasper Reports, I can't get any further here.

We use the following versions:

We have activated PDFA/1a in

What about the other cantons that use pyramid_oereb_mfp? Do you also have these errors? Do we want to investigate these errors?

michmuel commented 1 year ago

We have the same error messages concerning PDF/A compliance as BE.

We use also

I would appreciate if this could be fixed. Maybe @jwkaltz or @voisardf know if that can be done.

sitj-marc commented 1 year ago

Peter, I opened your file (20230203123527_extract.pdf) with Adobe Acrobat and I did got the blue message on the top that this file is conform to PDF/A

image

peterschaer commented 1 year ago

The blue message does not mean that the PDF is really compatible with PDF/A-1a, but only that it claims compatibility. Acrobat Reader does not check whether the PDF is compatible with PDF/A-1a or not. To do this you have to use some other tool like VeraPDF.

I also misunderstood this for a long time. The Confederation at the time of their acceptance tests probably did that too ;-)

sitj-marc commented 1 year ago

OK, good to know. Thank you for your feedback. Maybe the blue message is enough for the Confederation ;-)

voisardf commented 1 year ago

ok, I was not aware of that either. I guess we have the same issues as we use the same versions. I'll have to check to be sure.

peterschaer commented 1 year ago

While experimenting around, I noticed the following: if I comment out the federal logo, then the validation error with the ICC profile is no longer present. I.e. the way the federal logo is embedded is not PDF/A-1A compliant. All other images (logos canton, municipality, PLR, maps, legend images...) are embedded correctly. However, I have no idea why this is so.

voisardf commented 1 year ago

@peterschaer @jwkaltz Thanks Peter. I guess the federal logo we load(ed) in our database does not respect the compliance or has an other .icc profile than indicated.

I also conducted some tests replacing the hyperlinks by simple text fields and the remaining validation issues vanish. My conclusion is that the hyperlinkReference definition in the Jasper Report is missing something to be created pdf/a-1 compliant. Maybe @marionb or @sbrunner have already heard about that or are able to find out why? Missing library? Missing definition?

Looking at jasper community pages it should be possible to create compliant pdf's: https://community.jaspersoft.com/wiki/pdf-support-jasperreports-library and https://jasperreports.sourceforge.net/sample.reference/hyperlink/

voisardf commented 11 months ago

@voisardf check with different pdf validation tools, if the error still appears

jwkaltz commented 9 months ago

Summary of findings so far:

jwkaltz commented 9 months ago

Here is a proposal to extend the standard MapFish Print example test to include a hyperlink: https://github.com/mapfish/mapfish-print/pull/3139

Note that with this extended example, the PDF output by MapFish Print has the same VeraPDF validation problem as the Oereb PDFs: test-with-link.pdf

The validation output by VeraPDF is the same as reported above by @peterschaer, the rule https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-653-2 does not pass.

jwkaltz commented 9 months ago

The issue can be reproduced with a stripped down example in JasperReports, I have opened an issue about that: https://github.com/TIBCOSoftware/jasperreports/issues/410

jwkaltz commented 6 months ago

Update on this issue: it has been fixed; with the next release of MapFish-Print, this validation error should disappear.

voisardf commented 6 months ago

@jwkaltz great, thanks! could you indicate the version tag?

jwkaltz commented 6 months ago

@jwkaltz great, thanks! could you indicate the version tag?

@voisardf there is no new release of MapFish-Print yet.