Show PDF on my page

Does anyone know of a good way to have an interactable/live preview of PDF files and a good way to go about them? I'm trying to provide multiple research docs on my site and would like to showcase them trough PDF's (it is also a requirement to provide PDFs so why not show them as well?) I tried adding the pdfsclick library for Solid but it wouldn't show the PDFs (the examples also look a bit broken) and there was not a lot of documentation for it. Does anyone know about another good library to use with solid (maybe also Tailwind) or a way that I can implement it myself without a library?
5 Replies
andi
andi14mo ago
i don't think there's a solid specific library that would help your best bet might be to search for a pdf viewer library yourself and then integrate it into your solid app
Alex Lohr
Alex Lohr14mo ago
https://mozilla.github.io/pdf.js/ should be easily integrated.
PDF.js
A general-purpose, web standards-based platform for parsing and rendering PDFs.
Alex Lohr
Alex Lohr14mo ago
GitHub
pdf.js/examples/components/simpleviewer.mjs at master · mozilla/pdf...
PDF Reader in JavaScript. Contribute to mozilla/pdf.js development by creating an account on GitHub.
OldViking013
OldViking013OP14mo ago
Thanks for the replies, I eventually found a different solution by just embedding it into a container for it, seems to be working fine for what I need!
chaosprint
chaosprint5mo ago
what's your solution?
Want results from more Discord servers?
Add your server