Printing - Number of Pages

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Printing - Number of Pages

Brian King-2
Not sure if this is right place to ask, but it seemed like the closest ...

I am working on a printing extension for Firefox, and at various
intervals need to get the number of print pages of the loaded document.

This code should do the job:

var print = PrintUtils.getWebBrowserPrint();
var numpages = print.printPreviewNumPages;

... but the only catch (as the var name suggests) is that you have to be
in print preview mode for it to work. So I have an ugly hack in place to
toggle back and forth between print preview mode, but it is very
disconcerting on the eye. And even if I try to hide the content and
replace with something of my own when in print preview mode, I can't
surpress the print preview progress window.

So my question is ... is there an alternative way to get the number of
print pages of the document loaded?

--
Brian King
www.mozdev.org - free project hosting for the Mozilla community
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout