obsidian-markmind icon indicating copy to clipboard operation
obsidian-markmind copied to clipboard

[Feature request] Support for PDFs via File:// , HTTP:// and HTTPS://

Open andrewcrook opened this issue 2 years ago • 5 comments

I used a third-party tool to manage PDFs I do not want to duplicate them by having a copy in Obsiden.

I noticed that one of the other annotation plugins supported HTTP(s) it would download the PDF each time it was required, all the data is stored in a note as JSON same as your plugin.

This allowed me to use a PDF source such as http://localhost:8000/Stuff%20To%20Sort/PDF/21844.pdf

It would be great if MarkMind can also do this e.g annotate-target: http://localhost:8000/Stuff%20To%20Sort/PDF/21844.pdf

You could also support file:// and point to files outside of the Obsidian vault but on the same machine or mounted network share.

andrewcrook avatar Mar 11 '22 17:03 andrewcrook

Currently, file is supported , support for file://absolute pdf path

http(s) is not support

MarkMindCkm avatar Mar 12 '22 02:03 MarkMindCkm

@MarkMindCkm

Currently, file is supported , support for file://absolute pdf path

I cannot get this to work

---
mindmap-plugin: rich
annotate-target: file:///Volumes/NAS/Books/Mathematics/writing/How%20to%20Write%20Mathematics.pdf
annotate-type: pdf
---

I get file not found

However, loads fine in the browser (safari)

andrewcrook avatar Mar 14 '22 16:03 andrewcrook

@MarkMindCkm

Currently, file is supported , support for file://absolute pdf path

I cannot get this to work

---
mindmap-plugin: rich
annotate-target: file:///Volumes/NAS/Books/Mathematics/writing/How%20to%20Write%20Mathematics.pdf
annotate-type: pdf
---

I get file not found

However, loads fine in the browser (safari)

the reason is %20 ,please use space

---
annotate-target: file://D:test/math test.pdf
annotate-type: pdf
---

MarkMindCkm avatar Mar 15 '22 02:03 MarkMindCkm

@MarkMindCkm

Yes that does get around the issue thanks

However, I think the way other apps copy and paste including how Obsidian handles uri/url encodings it should be able to parse and use codes such as %20 as well.

encode

let encURI = encodeURI("file://w3docs/this is a test!/test.txt");
console.log(encURI);

> file://w3docs/this%20is%20a%20test!/test.txt

decode

let decURI = decodeURI("file://w3docs/this%20is%20a%20test!/test.txt");
console.log(decURI);

> file://w3docs/this is a test!/test.txt

or decoding mixed

let decURI = decodeURI("file://w3docs/this is a%20test!/test.txt");
console.log(decURI);

> file://w3docs/this is a test!/test.txt

These functions also work with HTTP(S) URLs

andrewcrook avatar Apr 20 '22 14:04 andrewcrook

@MarkMindCkm

Yes that does get around the issue thanks

However, I think the way other apps copy and paste including how Obsidian handles uri/url encodings it should be able to parse and use codes such as %20 as well.

encode

let encURI = encodeURI("file://w3docs/this is a test!/test.txt");
console.log(encURI);

> file://w3docs/this%20is%20a%20test!/test.txt

decode

let decURI = decodeURI("file://w3docs/this%20is%20a%20test!/test.txt");
console.log(decURI);

> file://w3docs/this is a test!/test.txt

or decoding mixed

let decURI = decodeURI("file://w3docs/this is a%20test!/test.txt");
console.log(decURI);

> file://w3docs/this is a test!/test.txt

These functions also work with HTTP(S) URLs

I will add this feature

MarkMindCkm avatar Apr 20 '22 14:04 MarkMindCkm