Do you remember PDF.js? Firefox built in PDF reader based on JavaScript and HTML5 progressing well so far, to the latest PDF.JS got Printing support in Firefox 18 nightly where Mozilla specially had to create a new API, MozPrintcallback that allows to print hundred or more pages in a PDF document easily with high quality without the need to render every page before printing, Mozilla employee Brendan dahi worked along with two others on this API said  “ we plan to propose it as a standard since we think it has many interesting use cases outside of pdf.js.” .

What mozprintCallback experimental API do?

mozPrintCallback – A new callback for canvas that is executed during the printing process. This callback can access the printing canvas context and perform any calls that are normally done to a 2D canvas context. When the callback is finished with rendering it must call printState.done() to tell the printing code to advance. The benefits of this approach are: 1) we don’t have to try and render every page before print, 2) the output gets rasterized later in the printing process where it should be. (This is not available for all platforms yet).

At present you can’t see the print button in Aurora and other earlier versions as mentioned above this experimental API is currently available in Firefox 18 nightly build only.

pdf.js print button

One more surprise change we spotted in nightly for Pdf.JS is Download button on UI works well with new download panel icon. When you try to download PDF by clicking on that button animation shown moving of download icon from UI on to green colored new download manager icon on toolbar indicates file being downloaded and that impressed me.

Fullscreen mode has been renamed to Presentation mode, click on that button on UI to switch to presentation mode which earlier called as fullscreen mode, you can exit from Presentation mode at any time by pressing Esc button on keyboard.

You can now use “Open file” control on UI to open any PDF file from your Computer.

Please share this article

Tweet | Submit to Reddit