vyleung / logseq-logtero-plugin

a Logseq plugin to create pages for Zotero items using custom page titles and properties
MIT License
23 stars 1 forks source link

I could not open pdf file directly in logseq #14

Open JWangL5 opened 2 years ago

JWangL5 commented 2 years ago

I have already install and configure properly, and it works well. But I can't open pdf file directly in logseq using {{pdf}} placeholder but open in my default pdf viewer. There's no auto pdf logo showed in block. Here is my page generated by logtero:

authors:: "Schnitzbauer, J., Strauss, M., Schlichthaerle, T., Schueder, F., Jungmann, R."
file-path:: D:\ZoteroData\storage\YE63XLY2\2017(Nat Protoc)Super-resolution microscopy with DNA-PAINT.pdf{{}}
url:: https://www.nature.com/articles/nprot.2017.024
year:: 2017
title:: @Schnitzbauer et al. (2017) Super-resolution microscopy with DNA-PAINT
local-library:: [Local library](zotero://select/library/items/Y46V595G)
doi:: 10.1038/nprot.2017.024
journal:: Nature Protocols
pdf:: ![2017(Nat Protoc)Super-resolution microscopy with DNA-PAINT.pdf](D:\ZoteroData\storage\YE63XLY2\2017(Nat Protoc)Super-resolution microscopy with DNA-PAINT.pdf)

I noticed the proper pdf was show if the pdf path is defaut assert path, or a {{zotero-import-file xxx}} followed by [name](path).

How could I solve this problem? Is there anything wrong in my configuration? My logseq is the latest (0.8.7).

vyleung commented 2 years ago

can you add file:\\\ in front of the file path to see if it works?

it'd look like this: pdf:: ![2017(Nat Protoc)Super-resolution microscopy with DNA-PAINT.pdf](file:\\\D:\ZoteroData\storage\YE63XLY2\2017(Nat Protoc)Super-resolution microscopy with DNA-PAINT.pdf)

JWangL5 commented 2 years ago

@vyleung Thanks for your reply. I have already tried the file:\\\, but it still opened in default pdf viewer. 😅

JWangL5 commented 2 years ago

@vyleung Could you modify the code to copy the pdf into a subfolder in assets folder, and insert the new path to logseq note? I have tried it could open in logseq if using the logseqfolder/assets folder witn the same syntax, like ![paperName](../assets/subfolder/paper.pdf), I think this maybe the easiest way to solve this problem and could meet my needs prefectly! Thanks a lot!