DEV Community

loading...

Discussion on: I am a JavaScript's biggest fan, Ask Me Anything!

Collapse
aswathm78 profile image
Aswath KNM

Have you ever used PDFJS.

Is there a chance to make responsive using pdfjs???

Collapse
drewknab profile image
Drew Knab • Edited

Kind of? Not really? I worked with it a couple of years ago.

You can write pdf.js views to shrink/grow with the web client's view height/width. But as far as I know the text size and margins will be rendered proportional to what is stored in the pdf so it isn't stretched or squeezed.

Because of that, it's pretty reliant on the original pdf.

Collapse
weirdmayo profile image
Daniel Mayovsky Ask Me Anything

Never used it. Don't really know what you meant by responsive. Looked up their documentation and have read a few examples, just now. The whole piece is controlled through JavaScript. If you have any ideas of changing the content/manipulating the content according to the screen size (responsive design), you can implmeent those ideas within JavaScript. Initiation of viewPort on canvas and so on, all happens in JS code. You will have to figure out your ideas with what you have on your own then :)

Collapse
aswathm78 profile image
Aswath KNM

What I meant is that is a PDF viewer entirely written in JS, but only works for bigger screens.