PDF's hosting and embedding. Whats the best solution?

Hello Peoples,
After many years of evangelising TW my better half has started to create her own knowledge base!
This is currently involving curation of PDF’s. Currently she is on tiddly host and embedding directly, but, this is resulting in big and slow.
Where would the braintrust suggest storing the PDF’s online so that, with minimal code, they can be embedded in Tiddlers?

Thank you all in advance.

Hi @Ste_W

Of course the best hosting solution is the one that is affordable and accessible to you. I can’t say what’s best for someone else, but I use dropbox (since I’ve long had an account anyway).

Even though dropbox isn’t really aimed at hosting for the web, you can do it with “this one simple trick”:

Dropbox tells you the url for a file (thinking you’ll put it in an email or something), and it looks like this:

https://www.dropbox.com/LONGSTRINGSTUFF.pdf?dl=0

The link lands you at a dropbox-managed view/preview page.

But if you replace the final dl=0 with raw=1 then the link is suitable for use as the _canonical_uri field of a tiddler with type application/pdf.

4 Likes

Hello @Ste_W and @Springer
here’s a link to how tobibeer solution does it.

I use Google drive: Tech Tips - Embed a PDF from Google Drive

You can either use the iframe code generated by Google, or just use the link of the embed and put it into the _canonical_uri field of a tiddler, with the type of the tiddler set to application/pdf

2 Likes

I use zotero or paperlib or https://calibre-ebook.com

And wiki only manage deeplink to them, and notes.

The google drive’s provided link worked fine for me in a new window, but in the _canonical_uri field of a tiddler (type:application/pdf) the result did not work at first …

feel free to read my initial frustration

The “Open the document directly” link works fine (It’s loaded in the tab to the right), and I’m even in the same browser session where I’m actively signed into the same google account (though permissions are set so that anyone with the link can view, so it shouldn’t matter whether I’m signed in).

I’ve replicated this on both my personal google account and my work account. In both cases, even when I’m signed in, and even with permissions set as broadly as possible, the embedding fails though the link works.

… so I poked around online, and found success with this modification of the end of the url (parallel to my dropbox url fix):

.../preview?usp=drivesdk

Swap preview in after the last / (instead of edit or view or whatever appears there).

1 Like

I use zotero to manage my papers, and when I want to see pdf files in tiddlywiki, I use links like zotero://paper_id, I think this is the best way for me.

OK…
What about PDF’s from git/ onedrive other popular hosting places, any tips, tricks, wrinkles?. I’ll make it up into a wiki post.

With git you can use GH-pages. The single file wiki can be in a eg: docs/ directory. The PDFs can go to /docs/files. So you can use a relative _canonical_uri: ./files/any-name.pdf.

GitLab should have a similar configuration, but I did test that one lately. The last time I did test the TW saver configuration may be 3 or 4 years ago.

The good thing of this configuration is, that it will also work, if you use a client / server configuration locally, to build the wiki. So the _canonical_uri can stay the same.


I think onedrive should be similar to dropbox. But I do not know. I don’t use it.

1 Like