diff --git a/History.md b/History.md index 718e3b1c..8d09ce9f 100644 --- a/History.md +++ b/History.md @@ -12,6 +12,7 @@ - #775 - #802 - #809 +- #812 2.16.3 diff --git a/library/src/main/java/org/mustangproject/FileAttachment.java b/library/src/main/java/org/mustangproject/FileAttachment.java index ed1fe39f..99a60419 100644 --- a/library/src/main/java/org/mustangproject/FileAttachment.java +++ b/library/src/main/java/org/mustangproject/FileAttachment.java @@ -9,7 +9,7 @@ public class FileAttachment { protected String filename; protected String mimetype; - protected String relation; + protected String relation = "Unspecified"; protected String description; protected byte[] data; @@ -29,6 +29,13 @@ public class FileAttachment { this.description = "Additional file attachment"; } + public FileAttachment(String filename, String mimetype, byte[] data) { + this.filename = filename; + this.mimetype = mimetype; + this.data = data; + this.description = "Additional file attachment"; + } + public String getDescription() { return description; } @@ -60,6 +67,28 @@ public class FileAttachment { return relation; } + /*** + * only needed when embedded in PDF described + * + * values + * - Source shall be used if this file specification is the original + * source material for the associated content. + * - Data shall be used if this file specification represents information + * used to derive a visual presentation, such as for a table or a + * graph. + * - Alternative shall be used if this file specification is an alternative + * representation of content, for example audio. + * - Supplement shall be used if this file specification represents a + * supplemental representation of the original source or data that + * may be more easily consumable (e.g. A MathML version of an + * equation). + * - Unspecified shall be used when the relationship is not known + * or cannot be described using one of the other values. + * @param relation String: either : Source, Data or Alternative. Usually Data, except source if the file attachment + * is the basis for the pdf (xrechnung2fx) or Alternative if it contains the same content (e.g. the + * factur-x.xml file in a factur-x PDF) + * @return fluent setter + */ public FileAttachment setRelation(String relation) { this.relation = relation; return this;