Silverbullet PDF - View and annotate PDFs inside Silverbullet

Some of you may already know or use Silverbullet PDF, but I updated it lately. It now supports viewing and annotating with all the power of the pdf.js viewer (the one Firefox also uses). Saving is done automatically, but you can also print or save to disk from the viewer.
If you are also using Silversearch, you will also be able to search through the text content of PDF files, automatically (If you are just installing Silverbullet PDF, you may need to run Silversearch: Reindex).

If you are having issues or missing features, let me know. Hope you enjoy.

3 Likes

I had this error…
SB 2.0.0, win11, brave


client.js?v=cache-1756474702924:441 [Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
t.onload	@	client.js?v=cache-1756474702924:441
init	@	client.js?v=cache-1756474702924:441
await in init		
switchToDocumentEditor	@	client.js?v=cache-1756474702924:441
loadDocumentEditor	@	client.js?v=cache-1756474702924:441
await in loadDocumentEditor		
(anonymous)	@	client.js?v=cache-1756474702924:443
(anonymous)	@	client.js?v=cache-1756474702924:42
navigate	@	client.js?v=cache-1756474702924:42
navigate	@	client.js?v=cache-1756474702924:441
editor.navigate	@	client.js?v=cache-1756474702924:98
syscall	@	client.js?v=cache-1756474702924:42
syscall	@	client.js?v=cache-1756474702924:42
onMessage	@	client.js?v=cache-1756474702924:42
worker.onmessage	@	client.js?v=cache-1756474702924:42

Ah, ok you either need the edge release of Silverbullet, which I think is the v2 tag for the docker image, or wait till a new release drops. I don’t know when @zef plans the next release.

1 Like

Hopefully this week

2 Likes

It works well on chrome based browsers but I’m running into a bug in safari (iOS and macOS).
The error message:

Failed to navigate: undefined is not an object (evaluating ‘this.iframe.contentWindow.silverbullet.dispatchEvent’)

I think this has to do with the iframe setup and safari being stricter than chrome, which results in window.silverbullet being undefined when initializing the viewer. I’m not sure how to solve the problem though.

Itgghhhhhh Urrghghghhgh, I guess the change I made to the way document editors are built in SB doesn’t really work for safari, because it handles the contentWindow differently during load. Unsure how I will solve this … I’ll have to see.

Hi @MrMugame , I'm having an issue with zooming: Zooming can affect UI components instead of PDF · Issue #1 · MrMugame/silverbullet-pdf · GitHub

This is not really significant on desktop anyway, but on mobile it can make the pdf viewing experience quite strange. Not sure whether this is intended behavior though, since the UI components got zoomed because silverbullet itself can be zoomed and the viewer is a "frame" inside SB.

Let us say we have some [[page]] where there's a [[path/to/pdf]] link. Perhaps a sane default would be: In [[page]] we can zoom in or out, and upon clicking on [[path/to/pdf]] the pdf viewer's top bar (which looks like SB) can inherit the size of [[page]] and stay invariant however the PDF gets zoomed.