This commit is contained in:
jstaerk
2025-04-14 09:46:34 +02:00
parent 97f6b6ad31
commit c30ceb9cf4
2 changed files with 31 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
- #775 - #775
- #802 - #802
- #809 - #809
- #812
2.16.3 2.16.3

View File

@@ -9,7 +9,7 @@ public class FileAttachment {
protected String filename; protected String filename;
protected String mimetype; protected String mimetype;
protected String relation; protected String relation = "Unspecified";
protected String description; protected String description;
protected byte[] data; protected byte[] data;
@@ -29,6 +29,13 @@ public class FileAttachment {
this.description = "Additional file attachment"; 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() { public String getDescription() {
return description; return description;
} }
@@ -60,6 +67,28 @@ public class FileAttachment {
return relation; 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) { public FileAttachment setRelation(String relation) {
this.relation = relation; this.relation = relation;
return this; return this;