Merge pull request #70 from InspireTechnologies/issue-38

Added setCreatorTool (implements #38)
This commit is contained in:
Jochen Staerk
2018-11-14 19:41:12 +01:00
committed by GitHub
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 PDFAIdentificationSchema pdfaid = null;
protected XMPMetadata xmp = null;
/** Producer attribute for PDF */
protected String producer = "mustangproject";
/** Author/Creator attribute for PDF for PDF */
protected String creator = "mustangproject";
/** CreatorTool */
protected String creatorTool = "mustangproject";
@Deprecated
private boolean ignoreA1Errors;
@@ -558,7 +562,7 @@ public class ZUGFeRDExporter implements Closeable {
XMPBasicSchema xsb = xmp.createAndAddXMPBasicSchema();
xsb.setCreatorTool(creator);
xsb.setCreatorTool(creatorTool);
xsb.setCreateDate(GregorianCalendar.getInstance());
// PDDocumentInformation pdi=doc.getDocumentInformation();
PDDocumentInformation pdi = new PDDocumentInformation();
@@ -619,6 +623,13 @@ public class ZUGFeRDExporter implements Closeable {
public void setCreator(String 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)

View File

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