Display a pdf in html, as an image

Asked

Viewed 163 times

0

I have an input file field, which searches a pdf on the client’s computer, and I would like to display it as if it were an image in html, I’m trying to do this, but I’m not finding an element that I can add the PDF path and display it, all the examples I’ve seen on the internet, are with Urls, and in this case, I would need for a file on the user’s computer, someone knows a way to do this?

  • 1

    From what I understand of your question, you will not be able to do this, take the image and render it directly in the browser. What you will have to do is by input take the pdf file, send it to a server and through a url render the image in a div or an iframe that is.

  • obg amigo, I thought I could display it like an image, but then there’s no way to even... too obggg by the answer.. Gradeco immensely

  • I don’t know what the context of your application is there, but, da para vc utilizar um plugin jQuery para visualizar pdf, then when the guy sends a file in the input he can view it.

  • https://stackoverflow.com/questions/12921052/parsing-pdf-pages-as-javascript-images You can render on canvas using this

  • @Sveen very obg, I’ll try to do with the canvas, and I’ll tell you if it worked.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.