#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

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

View File

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