mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Add default icons for FileAttachment annotations (bug 1230933)
*Please note:* This "borrows" the icons from Thunderbird. According to the PDF specification, see https://web.archive.org/web/20220309040754if_/https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.2096626, we should be providing default icons for FileAttachment annotations without appearances.
This commit is contained in:
parent
4f1b6f345b
commit
aa5b678f94
6 changed files with 42 additions and 2 deletions
|
@ -4274,10 +4274,15 @@ class FileAttachmentAnnotation extends MarkupAnnotation {
|
|||
constructor(params) {
|
||||
super(params);
|
||||
|
||||
const file = new FileSpec(params.dict.get("FS"), params.xref);
|
||||
const { dict, xref } = params;
|
||||
const file = new FileSpec(dict.get("FS"), xref);
|
||||
|
||||
this.data.annotationType = AnnotationType.FILEATTACHMENT;
|
||||
this.data.file = file.serializable;
|
||||
|
||||
const name = dict.get("Name");
|
||||
this.data.name =
|
||||
name instanceof Name ? stringToPDFString(name.name) : "PushPin";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue