#451 corrected so that file attachments are also possible if source is a PDF/A-1 (and destination PDF/A-3)
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
- filename of embedded file was not xrechnung.xml when using profile xrechnung #452
|
||||
- allow legalorganisation to have a tradingbusinessname #447
|
||||
- JSon deserialization does not work with BankDetails #455
|
||||
- Fix ClassCastException in CLI (Main.java). #451
|
||||
- Re-Formatted and re-organized POMs #446
|
||||
- changed additional references by line from String to List and implemented it on Item #454
|
||||
|
||||
2.12.0
|
||||
=======
|
||||
|
||||
@@ -735,11 +735,7 @@ public class Main {
|
||||
ze.setXML(Files.readAllBytes(Paths.get(xmlName)));
|
||||
|
||||
for (FileAttachment attachment : attachments) {
|
||||
if (((ZUGFeRDExporterFromPDFA) ze).getExporter() instanceof ZUGFeRDExporterFromA3 ) {
|
||||
((ZUGFeRDExporterFromA3) ((ZUGFeRDExporterFromPDFA) ze).getExporter()).attachFile(attachment.getFilename(), attachment.getData(), attachment.getMimetype(), attachment.getRelation());
|
||||
} else {
|
||||
System.err.println("IZUGFeRDExporter ze is not of type 'ZUGFeRDExporterFromA3'");
|
||||
}
|
||||
ze.attachFile(attachment.getFilename(), attachment.getData(), attachment.getMimetype(), attachment.getRelation());
|
||||
}
|
||||
|
||||
ze.export(outName);
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import jakarta.activation.DataSource;
|
||||
import org.mustangproject.FileAttachment;
|
||||
|
||||
public interface IZUGFeRDExporter extends Closeable, IExporter {
|
||||
/**
|
||||
@@ -64,6 +65,8 @@ public interface IZUGFeRDExporter extends Closeable, IExporter {
|
||||
public String getNamespaceForVersion(int ver);
|
||||
public String getPrefixForVersion(int ver) ;
|
||||
public IZUGFeRDExporter disableAutoClose(boolean disableAutoClose);
|
||||
public void attachFile(FileAttachment file);
|
||||
public void attachFile(String filename, byte[] data, String mimetype, String relation);
|
||||
public IXMLProvider getProvider();
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.apache.xmpbox.XMPMetadata;
|
||||
import org.apache.xmpbox.schema.PDFAIdentificationSchema;
|
||||
import org.apache.xmpbox.xml.DomXmpParser;
|
||||
import org.apache.xmpbox.xml.XmpParsingException;
|
||||
import org.mustangproject.FileAttachment;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -72,6 +73,7 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public IZUGFeRDExporter getExporter() {
|
||||
if (theExporter==null) {
|
||||
throw new RuntimeException("In ZUGFeRDExporterFromPDFA, source must always be loaded before other operations are performed.");
|
||||
@@ -247,5 +249,14 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
|
||||
public void export(OutputStream output) throws IOException {
|
||||
getExporter().export(output);
|
||||
}
|
||||
|
||||
public void attachFile(FileAttachment file) {
|
||||
theExporter.attachFile(file);
|
||||
}
|
||||
|
||||
public void attachFile(String filename, byte[] data, String mimetype, String relation) {
|
||||
theExporter.attachFile(filename, data, mimetype, relation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user