Skip to content
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 request] Support for PDFs via File:// , HTTP:// and HTTPS:// #230

Closed
andrewcrook opened this issue Mar 11, 2022 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@andrewcrook
Copy link

andrewcrook commented Mar 11, 2022

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.

@MarkMindCkm
Copy link
Owner

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

http(s) is not support

@MarkMindCkm MarkMindCkm added the enhancement New feature or request label Mar 12, 2022
@andrewcrook
Copy link
Author

andrewcrook commented Mar 14, 2022

@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)

@MarkMindCkm
Copy link
Owner

MarkMindCkm commented Mar 15, 2022

@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
---

@andrewcrook
Copy link
Author

@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

@MarkMindCkm
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants