ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
188 stars 111 forks source link

pdf/A-1b falsely invalid ? #244

Open obonnefon opened 3 years ago

obonnefon commented 3 years ago

Hello, here's a file considered by VeraPdf as a valid Pdf/A-1 but rejected by Mustang when trying to combine with xml file. (a pb of embedded font - Calibri) juin 22, 2021 8:23:07 AM org.apache.pdfbox.pdmodel.font.PDFont loadUnicodeCmap AVERTISSEMENT: Invalid ToUnicode CMap in font SVFUWB+Calibri,Bold juin 22, 2021 8:23:07 AM org.apache.pdfbox.pdmodel.font.PDFont loadUnicodeCmap AVERTISSEMENT: Invalid ToUnicode CMap in font CUMZOI+Calibri juin 22, 2021 8:23:07 AM org.apache.pdfbox.pdmodel.font.PDFont loadUnicodeCmap AVERTISSEMENT: Invalid ToUnicode CMap in font SVFUWB+Calibri,Bold juin 22, 2021 8:23:07 AM org.apache.pdfbox.pdmodel.font.PDFont loadUnicodeCmap AVERTISSEMENT: Invalid ToUnicode CMap in font CUMZOI+Calibri 08:23:07.383 [main] ERROR o.mustangproject.validator.Validator - File is not a valid PDF/A input file java.io.IOException: File is not a valid PDF/A input file at org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1.ensurePDFIsValid(ZUGFeRDExporterFromA1.java:81) at org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA3.load(ZUGFeRDExporterFromA3.java:121) at org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1.load(ZUGFeRDExporterFromA1.java:92) at org.mustangproject.commandline.Main.performCombine(Main.java:648) at org.mustangproject.commandline.Main.main(Main.java:403)

invoice.pdf

Thanks

jstaerk commented 3 years ago

Hi, as prevalidation Mustang uses the validation of PDFBox, you should be able to ignore that using ZUGFeRDExporter.ignoreA1Errors()

kind regards Jochen

amacado commented 2 years ago

I came across this issue and what might be useful for someone else encountering this problem using the CLI version: You can use the equivalent cli argument [-i, --ignorefileextension] which "Check for all files (.) instead of PDF files only (*.pdf) in metrics, ignore PDF/A input file errors in combine".

jstaerk commented 2 years ago

Is there anything wrong with Mustang, is it wrong in the file or is it wrong by PDFbox to report that?

jstaerk commented 2 years ago

see also #164 and #139

moritz commented 9 months ago

FYI I've also gotten the File is not a valid PDF/A-1 input file error with Mustang-CLI 2.8.0, with files generated as PDF-A/1 from GhostScript and from ocrmypdf.