New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Export notes containing images #201
Comments
We support that. Please use the export function provided by plugin, not the one provided by Zotero. |
What is the plugin version and Zotero version? |
I'm using the latest version of the plugin, 0.7.16 and zotero 6.0.15
|
Could you please share a screenshot of your note? If there are images, you could see output like
|
I've test on a totally new install of Zotero and plugin without login on Windows 11, Ubuntu 16.04 and Ubuntu 22.04 LTS. They seem to be OK to export either w/ or w/o images. Any hints of the possible causes? Like write access to the directory, an incomplete Zotero installation? Right-click on the image and try to save as... it to the same directory, see if it works as expected? If anyone else also meets this, please let me know. Currently I cannot provide any help because the cause is unclear. |
Oh, I didn't specify: I'm running Fedora Linux. |
Could you please select the note containing images in the library and go to Tools-Developers-Run Javascript, then paste and click var item = ZoteroPane.getSelectedItems()[0];
item.getNote(); Please post the result here or email me(wyzlshx@foxmail.com). This is the content of the note. |
Sure, here you go.
|
try to run this in the Run JS window, with note item selected: var item = ZoteroPane.getSelectedItems()[0];
var imgKey = "PQN9A3AL"
var imgItem = await Zotero.Items.getByLibraryAndKeyAsync(
item.libraryID,
imgKey
);
return [imgItem, await imgItem.getFilePathAsync()] |
It returns this:
I checked at that location and the image is in fact stored there. |
在 Arch Linux (6.0.8-arch1-1)中也有这个问题,执行后面的 JS,图片放在了
|
Hi, I'm not sure why images failed to be exported. Could you please check this:
Zotero.Knowledge4Zotero.NoteExport._exportPath;
await Zotero.File.createDirectoryIfMissingAsync(Zotero.Knowledge4Zotero.NoteExport._exportPath); |
Export still failed.
Run this, print the export path:
Run this, created correct folder. ~/Documents/notes/50Search master !6 ?12 11:54:35 ─╮
❯ ls | grep attachment ─╯
~/Documents/notes/50Search master !6 ?12 12:02:06 ─╮
❯ ls | grep attachment ─╯
attachments |
Oh I see. I don't know why but it seems you have a path starts with Could you please try if this version works? (Install it directly and do not unzip it.) |
Use this new version(direct installation without uninstalling the old version), it works good. The new debug info during the export (use the USERID to replace the true ID): (3)(+0021555): Knowledge4Zotero: onEditorEvent export
(3)(+0001274): { "dataIn": null "dataOut": { "embedLink": false "exportNote": false "exportMD": true "exportSubMD": false "exportAutoSync": false "exportHighlight": true "convertSquare": true "exportDocx": false "exportPDF": false "exportFreeMind": false } "deferred": { "resolve": function(value) {...} "reject": function (reason) {...} "promise": { "isFulfilled": false, "isRejected": false } } }
(3)(+0000000): { "embedLink": false "exportNote": false "exportMD": true "exportSubMD": false "exportAutoSync": false "exportHighlight": true "convertSquare": true "exportDocx": false "exportPDF": false "exportFreeMind": false }
(3)(+0002519): <img alt="" data-attachment-key="GD8HQBB8" data-annotation="%7B%22attachmentURI%22%3A%22http%3A%2F%2Fzotero.org%2Fusers%2FUSERID%2Fitems%2FYQKAGTD3%22%2C%22annotationKey%22%3A%22SUP8YZ6K%22%2C%22color%22%3A%22%23ffd400%22%2C%22pageLabel%22%3A%222%22%2C%22position%22%3A%7B%22pageIndex%22%3A1%2C%22rects%22%3A%5B%5B322.083%2C394.083%2C570.417%2C413.25%5D%5D%7D%2C%22citationItem%22%3A%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fusers%2FUSERID%2Fitems%2FDCSNWD9F%22%5D%2C%22locator%22%3A%222%22%7D%7D" height="32" width="414">
(3)(+0000000): ----Debug Link----
(3)(+0000001): { "attachmentURI": "http://zotero.org/users/USERID/items/YQKAGTD3" "annotationKey": "SUP8YZ6K" "color": "#ffd400" "pageLabel": "2" "position": { "pageIndex": 1 "rects": [ "0": [ "0": 322.083 "1": 394.083 "2": 570.417 "3": 413.25 ] ] } "citationItem": { "uris": [ "0": "http://zotero.org/users/USERID/items/DCSNWD9F" ] "locator": "2" } }
(3)(+0000000): http://zotero.org/users/USERID/items/YQKAGTD3
(3)(+0000000): YQKAGTD3
(3)(+0000000): <img alt="" data-attachment-key="XWIYAZ95" data-annotation="%7B%22attachmentURI%22%3A%22http%3A%2F%2Fzotero.org%2Fusers%2FUSERID%2Fitems%2FYQKAGTD3%22%2C%22annotationKey%22%3A%224EUX92EV%22%2C%22color%22%3A%22%23ffd400%22%2C%22pageLabel%22%3A%223%22%2C%22position%22%3A%7B%22pageIndex%22%3A2%2C%22rects%22%3A%5B%5B88.75%2C473.667%2C527.083%2C732.833%5D%5D%7D%2C%22citationItem%22%3A%7B%22uris%22%3A%5B%22http%3A%2F%2Fzotero.org%2Fusers%2FUSERID%2Fitems%2FDCSNWD9F%22%5D%2C%22locator%22%3A%223%22%7D%7D" height="432" width="731">
(3)(+0000000): ----Debug Link----
(3)(+0000000): { "attachmentURI": "http://zotero.org/users/USERID/items/YQKAGTD3" "annotationKey": "4EUX92EV" "color": "#ffd400" "pageLabel": "3" "position": { "pageIndex": 2 "rects": [ "0": [ "0": 88.75 "1": 473.667 "2": 527.083 "3": 732.833 ] ] } "citationItem": { "uris": [ "0": "http://zotero.org/users/USERID/items/DCSNWD9F" ] "locator": "3" } }
(3)(+0000000): http://zotero.org/users/USERID/items/YQKAGTD3
(3)(+0000000): YQKAGTD3
(3)(+0000002): { "key": "GD8HQBB8", "version": 11829, "itemType": "attachment", "parentItem": "G59NQXJ7", "linkMode": "embedded_image", "contentType": "image/png", "filename": "image.png", "dateAdded": "2022-11-15T14:39:39Z", "dateModified": "2022-11-15T14:39:39Z" }
(3)(+0000002): /home/zz/Documents/Zotero/storage/GD8HQBB8/image.png
(3)(+0000000): /home/zz/Documents/notes/50Search/attachments/GD8HQBB8.png
(3)(+0000002): attachments/GD8HQBB8.png
(3)(+0000001): { "key": "XWIYAZ95", "version": 11837, "itemType": "attachment", "parentItem": "G59NQXJ7", "linkMode": "embedded_image", "contentType": "image/png", "filename": "image.png", "dateAdded": "2022-11-16T05:05:56Z", "dateModified": "2022-11-16T05:05:56Z" }
(3)(+0000002): /home/zz/Documents/Zotero/storage/XWIYAZ95/image.png
(3)(+0000000): /home/zz/Documents/notes/50Search/attachments/XWIYAZ95.png
(3)(+0000001): attachments/XWIYAZ95.png
(3)(+0000000): DCSNWD9F
(3)(+0000000): DCSNWD9F The path |
Glad to know. Fixed in v0.7.20 |
I confirm it's fixed in 0.7.20. Thank you very much for your great work! |
Is your feature request related to a problem? Please describe.
It is currently impossible to export notes which contain images.
Describe the solution you'd like
The note is exported and the contained images are exported as well and linked in the md file.
Describe alternatives you've considered
Remove images from Zotero notes.
The text was updated successfully, but these errors were encountered: