in-line PDF to image conversion (js & html)

  firefox, frontend, html, javascript, pdf

I’m currently building a website that shows a diagram when a certain object is clicked on (with properties a, b, m and s). Problem is, the diagram is in pdf format and I want to show it like an image (no toolbars, no plug-in viewer, just the diagram). I tried using toolbar=0, which works fine in all browsers but firefox.

this is the code I use. I also tried using iframe and embed instead of object, however they fail to show the error message when the desired pdf is not available (which is crucial in this case).

/*document.getElementById("plot-container").innerHTML = "<object data='"+a+"-"+b+"-"+ Number(10+(s*2))+"-"+m+".pdf#toolbar=0' width='100%'> <p>errormessage</p> </object>";*/

Since I am new to js i am not sure how to proceed here. I also want to mention that there are more than 30,000 different plots this function can potentially call, so manually converting them is not really an option.
Is there a way to use an in-line pdf to image converter? or specify a certain pdf viewer to be used, so toolbar=0 works for firefox as well?

Thank you!

Source: Ask Javascript Questions

LEAVE A COMMENT