Merge pull request #1065 from langfr/bugfix/1062

Move getNamespaceForVersion and getPrefixForVersion to inheriting class.
This commit is contained in:
Frank Langelage
2026-04-25 13:39:13 +02:00
committed by GitHub
4 changed files with 42 additions and 41 deletions

View File

@@ -41,28 +41,6 @@ public class DXExporterFromA1 extends DXExporterFromA3 {
private static boolean isValidA1(DataSource dataSource) throws IOException { private static boolean isValidA1(DataSource dataSource) throws IOException {
return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser (dataSource)); return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser (dataSource));
} }
/***
* internal helper function: get namespace for order-x
* @param ver the delivery-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
// As of late 2022 the Delivery-X standard is not yet published. See specification:
// Die digitale Ablösung des Papier-Lieferscheins, Version 1.1, April 2022
// Chapter 7.1 XMP-Erweiterungsschema für PDF/A-3
// http://docplayer.org/230301085-Der-digitale-lieferschein-dls.html
return "urn:factur-x:pdfa:CrossIndustryDocument:despatchadvice:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException { private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException {
/* /*

View File

@@ -130,6 +130,29 @@ public class DXExporterFromA3 extends ZUGFeRDExporterFromA3 {
private boolean attachZUGFeRDHeaders = true; private boolean attachZUGFeRDHeaders = true;
/***
* internal helper function: get namespace for order-x
* @param ver the delivery-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
// As of late 2022 the Delivery-X standard is not yet published. See specification:
// Die digitale Ablösung des Papier-Lieferscheins, Version 1.1, April 2022
// Chapter 7.1 XMP-Erweiterungsschema für PDF/A-3
// http://docplayer.org/230301085-Der-digitale-lieferschein-dls.html
return "urn:factur-x:pdfa:CrossIndustryDocument:despatchadvice:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
/** /**
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the * Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
* metadata level, this will not e.g. convert graphics to JPG-2000) * metadata level, this will not e.g. convert graphics to JPG-2000)

View File

@@ -41,24 +41,6 @@ public class OXExporterFromA1 extends OXExporterFromA3 {
private static boolean isValidA1(DataSource dataSource) throws IOException { private static boolean isValidA1(DataSource dataSource) throws IOException {
return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser(dataSource)); return getPDFAParserValidationResult(PreflightParserHelper.createPreflightParser(dataSource));
} }
/***
* internal helper function: get namespace for order-x
* @param ver the order-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
return "urn:factur-x:pdfa:CrossIndustryDocument:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException { private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException {
/* /*

View File

@@ -126,9 +126,27 @@ public class OXExporterFromA3 extends ZUGFeRDExporterFromA3 {
*/ */
protected String orderXDocumentType = "ORDER"; protected String orderXDocumentType = "ORDER";
private boolean attachZUGFeRDHeaders = true; private boolean attachZUGFeRDHeaders = true;
/***
* internal helper function: get namespace for order-x
* @param ver the order-x version
* @return the URN of the namespace
*/
@Override
public String getNamespaceForVersion(int ver) {
return "urn:factur-x:pdfa:CrossIndustryDocument:1p0#";
}
/***
* internal helper: returns the namespace prefix for the given order-x version number
* @param ver the ox version
* @return the namespace prefix as string, without colon
*/
@Override
public String getPrefixForVersion(int ver) {
return "fx";
}
/** Defines whether attachments to the PDF should be using FLATE compression */ /** Defines whether attachments to the PDF should be using FLATE compression */
private boolean compressionEnabled = false; private boolean compressionEnabled = false;