Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ public class GFEmbeddedFile extends GFExternal implements EmbeddedFile {
public static final String EMBEDDED_FILE_TYPE = "EmbeddedFile";

private final COSStream stream;
protected String id;

public GFEmbeddedFile(COSStream stream) {
super(EMBEDDED_FILE_TYPE);
this.stream = stream;

if (stream != null) {
COSKey key = stream.getObjectKey();
id = key != null ?
key.getNumber() + " " + key.getGeneration() + " obj " + this.getObjectType()
: super.getID();
}
}

@Override
Expand All @@ -84,6 +92,11 @@ public Boolean getisValidPDFA12() {
public Boolean getisValidPDFA124() {
return isValidPDFA(new HashSet<>(Arrays.asList(PDFAFlavour.PDFA_1_B, PDFAFlavour.PDFA_2_B, PDFAFlavour.PDFA_4)));
}

@Override
public String getID() {
return this.id == null ? super.getID() : this.id;
}

private boolean isValidPDFA(Set<PDFAFlavour> flavours) {
if (this.stream == null) {
Expand Down
Loading