closes #392
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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>();
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user