This commit is contained in:
jstaerk
2024-06-27 10:47:50 +02:00
parent cbd8f71ca0
commit 53391eaf13
8 changed files with 262 additions and 217 deletions

View File

@@ -31,12 +31,6 @@ import org.mustangproject.EStandard;
import jakarta.activation.DataSource;
public class ZUGFeRDExporterFromA1 extends ZUGFeRDExporterFromA3 implements IZUGFeRDExporter {
protected boolean ignorePDFAErrors = false;
public ZUGFeRDExporterFromA1 ignorePDFAErrors() {
this.ignorePDFAErrors = true;
return this;
}
private static boolean isValidA1(DataSource dataSource) throws IOException {
return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser(dataSource));

View File

@@ -80,7 +80,12 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
private boolean isFacturX = true;
public static final int DefaultZUGFeRDVersion = 2;
protected boolean ignorePDFAErrors = false;
public ZUGFeRDExporterFromA3 ignorePDFAErrors() {
this.ignorePDFAErrors = true;
return this;
}
protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
protected ArrayList<FileAttachment> fileAttachments = new ArrayList<FileAttachment>();

View File

@@ -49,14 +49,28 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
protected IZUGFeRDExporter theExporter;
protected boolean ignorePDFAErrors = false;
public ZUGFeRDExporterFromPDFA ignorePDFAErrors() {
this.ignorePDFAErrors = true;
return this;
}
protected void determineAndSetExporter(int PDFAVersion) {
if (PDFAVersion == 3) {
theExporter = new ZUGFeRDExporterFromA3();
if (ignorePDFAErrors) {
((ZUGFeRDExporterFromA3)theExporter).ignorePDFAErrors();
}
} else if (PDFAVersion == 1) {
theExporter = new ZUGFeRDExporterFromA1();
if (ignorePDFAErrors) {
((ZUGFeRDExporterFromA1)theExporter).ignorePDFAErrors();
}
} else {
throw new IllegalArgumentException("PDF-A version not supported");
}
}
protected IZUGFeRDExporter getExporter() {
if (theExporter==null) {