Document viewer with ViewerJS

I’m trying to implement viewerJS to anvil to make a simple preview of the documents saved in the database.

What I’ve tried and what’s not working:
I’m not sure how to implement it in anvil.
I’ve downloaded all assets from viewerJS and tried to implement it in a simple form, but my experience in JS is limited and it’s making it hard to implement.

Clone link:

You might look at the recently posted PDF viewer which also incorporates a Javascript library and see how they did it: Custom PDF Viewer using PDF.js

2 Likes