added failing test for pdf a schema extensions
This commit is contained in:
@@ -49,10 +49,16 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
|||||||
* filename of an PDF/A1 compliant document
|
* filename of an PDF/A1 compliant document
|
||||||
*/
|
*/
|
||||||
public ZUGFeRDExporter load(String pdfFilename) throws IOException {
|
public ZUGFeRDExporter load(String pdfFilename) throws IOException {
|
||||||
|
|
||||||
ensurePDFIsValidPDFA(new FileDataSource(pdfFilename));
|
ensurePDFIsValidPDFA(new FileDataSource(pdfFilename));
|
||||||
|
ZUGFeRDExporter zugFeRDExporter;
|
||||||
PDDocument doc = PDDocument.load(new File(pdfFilename));
|
PDDocument doc = PDDocument.load(new File(pdfFilename));
|
||||||
prepareDocument(doc);
|
prepareDocument(doc);
|
||||||
return new ZUGFeRDExporter(doc);
|
zugFeRDExporter = new ZUGFeRDExporter(doc);
|
||||||
|
zugFeRDExporter.setZUGFeRDVersion(ZFVersion);
|
||||||
|
zugFeRDExporter.setZUGFeRDConformanceLevel(zugferdConformanceLevel);
|
||||||
|
return zugFeRDExporter;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -107,6 +113,7 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
|||||||
prepareDocument(doc);
|
prepareDocument(doc);
|
||||||
zugFeRDExporter = new ZUGFeRDExporter(doc);
|
zugFeRDExporter = new ZUGFeRDExporter(doc);
|
||||||
zugFeRDExporter.setZUGFeRDVersion(ZFVersion);
|
zugFeRDExporter.setZUGFeRDVersion(ZFVersion);
|
||||||
|
zugFeRDExporter.setZUGFeRDConformanceLevel(zugferdConformanceLevel);
|
||||||
return zugFeRDExporter;
|
return zugFeRDExporter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,8 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
ze.close();
|
ze.close();
|
||||||
String pdfContent = baos.toString("UTF-8");
|
String pdfContent = baos.toString("UTF-8");
|
||||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||||
|
// check for pdf-a schema extension
|
||||||
|
assertFalse(pdfContent.indexOf("<fx:DocumentFileName>factur-x.xml</fx:DocumentFileName>")==-1);
|
||||||
assertFalse(pdfContent.indexOf("urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:extended")==-1);
|
assertFalse(pdfContent.indexOf("urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:extended")==-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user