From 688298af7f463e4ae64d537c0d708f43ff26f8ab Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 27 Dec 2020 20:02:15 -0500 Subject: [PATCH] Add Zotero.Item::isPDFAttachment() Returns true for stored or linked PDFs --- chrome/content/zotero/xpcom/data/item.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 923961113b..2e9af99a59 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2248,6 +2248,14 @@ Zotero.Item.prototype.isEmbeddedImageAttachment = function() { } +/** + * @return {Boolean} - Returns true if item is a stored or linked PDF attachment + */ +Zotero.Item.prototype.isPDFAttachment = function () { + return this.isAttachment() && this.attachmentContentType == 'application/pdf'; +}; + + /** * Returns number of child attachments of item *