[Jsprintsetup] How enable jsPrintSetup with xul application?

Dimitar Angelov mitko at edabg.com
Wed Apr 14 02:12:44 PDT 2010


Thank you for the interest to our extension!

Unfortunately I'm not expert in XUL applications development.
I think that second variant (extracting jsPrintSetup.js) of using
jsPrintSetup is only possible.
I'm not sure about which interfaces used from jsPrintSetup are
implemented in xulrunner library(you can view in source code).
Especially about print dialog I thing that things there are more
complicated. Firefox for example in different platforms solve this
differently for example in Windows there two choices: use native Windows
print dialog or use FF specific print dialog. Printing in FF (include
and print dialog) facilities are implemented in toolkit part of FF
(toolkit.jar) you can see at
For example PrintUtils.js manage printing printDialog.xul and
printDialog.js are about FF specific print dialog and so on.
You also may be interesting from this thread

In conclusion I think that you can use jsPrintExtension only if you are
using as part of you code and may be needed to be adjusted for
standalone (outside FF) environment.

If you have any other questions, do not hesitate to contact with me.


Dimitar Angelov

On 25.2.2010 г. 10:11, evapaddy at gmail.com wrote:
> Hi,
> I'm currently working on a web application project.
> Since our requirement on client side is a plain web browser without 
> toolbars, menubars, search bars or anything else.
> So we choose xulrunner. The xul file is quite simple, only a browser 
> control is declared.
> But jsPrintSetup doesn't work with xulrunner environment, while it works 
> quite well under firefox.
> I've tried these:
> 1. Put the xpi file into {application}\extensions\, and enable extension 
> management.
> Start application, extension install dialog shows up, then click 
> "Install" button.
> The sample html page is displayed, and no print dialog displayed.
> 2. Extract xpi file and put jsPrintSetup.js into {application}\components.
> NSGetModule function is called (I add some dump message to the console).
> The sample html page is displayed, and no print dialog displayed too.
> jsPrintSetup js code in the sample page was copied from 
> http://jsprintsetup.mozdev.org/reference.html, and commented
> jsPrintSetup.setOption('printSilent', 1);
> to let print dialog be displayed when jsPrintSetup.print() called.
> I'm new to xulrunner, and can't figure out the problem.
> xulrunner-1.9.2.en-US.win32.sdk is installed on my computer.
> Have you got any ideas? Any help would be appreciated.

More information about the Jsprintsetup mailing list