Merge branch 'master' of github.com:ZUGFeRD/mustangproject

This commit is contained in:
Jochen Stärk
2019-01-25 16:13:45 +01:00
2 changed files with 23 additions and 1 deletions

View File

@@ -100,8 +100,12 @@ public class ZUGFeRDExporter implements Closeable {
protected PDMetadata metadata = null; protected PDMetadata metadata = null;
protected PDFAIdentificationSchema pdfaid = null; protected PDFAIdentificationSchema pdfaid = null;
protected XMPMetadata xmp = null; protected XMPMetadata xmp = null;
/** Producer attribute for PDF */
protected String producer = "mustangproject"; protected String producer = "mustangproject";
/** Author/Creator attribute for PDF for PDF */
protected String creator = "mustangproject"; protected String creator = "mustangproject";
/** CreatorTool */
protected String creatorTool = "mustangproject";
@Deprecated @Deprecated
private boolean ignoreA1Errors; private boolean ignoreA1Errors;
@@ -558,7 +562,7 @@ public class ZUGFeRDExporter implements Closeable {
XMPBasicSchema xsb = xmp.createAndAddXMPBasicSchema(); XMPBasicSchema xsb = xmp.createAndAddXMPBasicSchema();
xsb.setCreatorTool(creator); xsb.setCreatorTool(creatorTool);
xsb.setCreateDate(GregorianCalendar.getInstance()); xsb.setCreateDate(GregorianCalendar.getInstance());
// PDDocumentInformation pdi=doc.getDocumentInformation(); // PDDocumentInformation pdi=doc.getDocumentInformation();
PDDocumentInformation pdi = new PDDocumentInformation(); PDDocumentInformation pdi = new PDDocumentInformation();
@@ -619,6 +623,13 @@ public class ZUGFeRDExporter implements Closeable {
public void setCreator(String creator) { public void setCreator(String creator) {
this.creator = creator; this.creator = creator;
} }
/**
* the CreatorTool attribute for the PDF
* @param creator
*/
protected void setCreatorTool(String creatorTool) {
this.creatorTool = creatorTool;
}
/** /**
* the authoring software (use factory method instead) * the authoring software (use factory method instead)

View File

@@ -36,8 +36,12 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
protected boolean ignorePDFAErrors = false; protected boolean ignorePDFAErrors = false;
protected ZUGFeRDConformanceLevel zugferdConformanceLevel = ZUGFeRDConformanceLevel.EXTENDED; protected ZUGFeRDConformanceLevel zugferdConformanceLevel = ZUGFeRDConformanceLevel.EXTENDED;
protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE; protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
/** Producer (attribute for PDF */
protected String producer = "mustangproject"; protected String producer = "mustangproject";
/** Human creator (attribute for PDF) */
protected String creator = "mustangproject"; protected String creator = "mustangproject";
/** Creator tool (attribute for PDF) */
protected String creatorTool = null;
protected int ZFVersion=ZUGFeRDExporter.DefaultZUGFeRDVersion; protected int ZFVersion=ZUGFeRDExporter.DefaultZUGFeRDVersion;
protected boolean ensurePDFisUpgraded=false; protected boolean ensurePDFisUpgraded=false;
@@ -58,6 +62,8 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
zugFeRDExporter.setZUGFeRDVersion(ZFVersion); zugFeRDExporter.setZUGFeRDVersion(ZFVersion);
zugFeRDExporter.setZUGFeRDConformanceLevel(zugferdConformanceLevel); zugFeRDExporter.setZUGFeRDConformanceLevel(zugferdConformanceLevel);
zugFeRDExporter.setCreator(creator); zugFeRDExporter.setCreator(creator);
// Use creator as default for compatibility
zugFeRDExporter.setCreatorTool(creatorTool != null ? creatorTool : creator);
zugFeRDExporter.setProducer(producer); zugFeRDExporter.setProducer(producer);
zugFeRDExporter.setAttachZUGFeRDHeaders(attachZUGFeRDHeaders); zugFeRDExporter.setAttachZUGFeRDHeaders(attachZUGFeRDHeaders);
zugFeRDExporter.setPDFA3(ensurePDFisUpgraded); zugFeRDExporter.setPDFA3(ensurePDFisUpgraded);
@@ -190,6 +196,11 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
this.creator = creator; this.creator = creator;
return this; return this;
} }
public IExporterFactory setCreatorTool(String creatorTool) {
this.creatorTool = creatorTool;
return this;
}
public IExporterFactory setProducer(String producer) { public IExporterFactory setProducer(String producer) {
this.producer = producer; this.producer = producer;