steveryan
Phoenix LiveView pdf viewer
Hey All,
Building a Phoenix LiveView app that allows you to upload a file (currently only markdown supported) and advance through the pages one at a time, and I would like it to support pdf files. I have been looking for a package that can do this, but I can’t find one.
I’d love to be able to provide a pdf, and a page number and render that page of the pdf in my LiveView page.
Is there anything out there like this for Elixir/Phoenix?
Most Liked
egze
zimt28
bratsche
In the past I’ve used the command line tool pdfimages that’s included in poppler and had some success with it. For example, you can shell out to pdfimages -list <filename> to get a list of pages with some information about them, and you can convert the PDF into a series of images that you can render in LiveView.
Last Post!
mayel
I’ve just experimented with the SVG support. There’s an issue with multipage PDFs in that it generates multi-page SVGs which unfortunately doesn’t seem supported by browsers. You can do one page at a time though with pdfseparate input.pdf ouput-%d.pdf (that command also comes with poppler) and then pdftocairo -svg on each page.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









