1

I've been having a problem that's just been wracking my brain. I need to programatically control a PDF's view in a webpage via javascript, that is, to zoom in and out, scroll horizontally and vertically and rotate it. I'm indiferent as to whether the PDF is loaded as an object tag in HTML, via a jquery plugin or whatever.

I snooped around and basically saw that Adobe provides a way to do so with their viewer, but this seems dependant on the user's PDF viewer of choice. I also took a look at Mozilla's pdf.js, but I could not, for the life of me, even load the document on Windows.

So, can anyone confirm me if these are my only options to acheive what I want? If not, what alternatives do I have?

To those wondering why I might need this, I'm implementing control via Kinect on some webpages and need to trigger scrolling and zooming in certain circunstances.

Best Regards, João Fernandes

1
  • Because you always are controlling a helper application, you will depend on that helper application's capabilities. That also means that you will not be able to have a "general" control. Even embed the controls in the document would not work, because they too depend on the actual viewing helper. Commented Apr 8, 2014 at 11:33

1 Answer 1

1

PDF.JS should do what you are after, or try FlexPaper if you need it to work across all devices. Maybe you can specify a bit further what it was that wasn't working when you were using PDF.JS? it should be pretty straight forward to get starting using that library.

Sign up to request clarification or add additional context in comments.

1 Comment

I ended up solving this through PDF.JS, thanks. It's just that I had problems compiling it in the first place (it compiled with a malformed string), then reading a file (I wasn't running a local server, just opening the HTML for the page) and finally I got stuck figuring how to actually make a viewer before realizing I could just embed the default one. It's all working fine now though!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.