Posting after a long time, have been keeping busy on the academic front lately. So, about the eBook reader, the task I had to do after rendering the pdf view was to generate thumbnails for PDFs dynamically.
The best way you can generate image thumbnails for in PHP is if you use imagemagik. But using that would require users to install imagemagik with ownCloud before using the app, so I decided to rather wait for the thumbnail api to come out and figure out a different solution till then. That ways I get to have even more fun.
I read about the rendering HTML in an HTML canvas element, and decided to give it a try. This was with the help of javascript. In my javascript code, I read the anchor tags for names of the pdf files, create canvas elements and render the scaled version of the PDFs on to the canvases.
The bad part was, this happens only when the page loads and takes time for the thumbnails to load. A better and faster approach would have been to create images and probably store them, so that when the page loads, the images are fetched from the data directory.
What I have figured to remedy this would be to capture the canvas data as an image using the 'toDaraUrl' javascript method and store them in the ownCloud data directory, so that next time when the thumbnails are displayed, they are instead fetched from the data directory. This would reduce the load time to a good extent.