corrected possibility to switch to ZF2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
1.4.1
|
||||
1.5.0
|
||||
=====
|
||||
<date>
|
||||
Now using factory. Export now also possible on OutputStream.
|
||||
Further dev improvements: no more need to call PDFattachZugferdFile(null);
|
||||
toecount now has options to combine documents and upgrade xml file from ZF1 to ZF2
|
||||
|
||||
@@ -31,6 +31,7 @@ public interface IExporterFactory {
|
||||
public IExporterFactory setCreator(String creator);
|
||||
public IExporterFactory setConformanceLevel(PDFAConformanceLevel newLevel);
|
||||
public IExporterFactory setProducer(String producer) ;
|
||||
public IExporterFactory setZUGFeRDVersion(int version);
|
||||
public IExporterFactory ignorePDFAErrors();
|
||||
public IExporterFactory setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel zugferdConformanceLevel);
|
||||
public IExporterFactory setAttachZUGFeRDHeaders(final boolean attachZugferdHeaders);
|
||||
|
||||
@@ -62,10 +62,6 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
}
|
||||
|
||||
|
||||
public void setZUGFeRDversion(int version) {
|
||||
ZFVersion=version;
|
||||
}
|
||||
|
||||
public void prepareDocument(PDDocument doc) throws IOException {
|
||||
String fullProducer = producer + " (via mustangproject.org " + org.mustangproject.ZUGFeRD.Version.VERSION + ")";
|
||||
|
||||
@@ -264,4 +260,11 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
this.producer = producer;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IExporterFactory setZUGFeRDVersion(int version) {
|
||||
this.ZFVersion=version;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +192,8 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
zea1.close();
|
||||
String pdfContent=baos.toString("UTF-8");
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org")==-1);
|
||||
assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>BASIC</zf:ConformanceLevel>") == -1);
|
||||
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -341,7 +341,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
holder = zi.getHolder();
|
||||
ref = zi.getForeignReference();
|
||||
}
|
||||
// this resembles the data written in MustangReaderWriterCustomXMLTest
|
||||
// this resembles the data written in MustangReaderWriterCustomXMLTest
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(bic, "COBADEFFXXX");
|
||||
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
|
||||
@@ -366,8 +366,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
|
||||
ze.setZUGFeRDVersion(2);
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.disableAutoClose(true);
|
||||
@@ -379,8 +378,8 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
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("<fx:ConformanceLevel>EXTENDED</fx:ConformanceLevel>") == -1);
|
||||
assertFalse(pdfContent.indexOf("urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:extended") == -1);
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
|
||||
Reference in New Issue
Block a user