#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:
jstaerk
2024-08-28 13:56:45 +02:00
parent 302011e23a
commit 5a963a7ecf
4 changed files with 19 additions and 6 deletions

View File

@@ -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);