[Jslib] prefs.js

Pete Collins pete at mozdevgroup.com
Fri Sep 23 08:57:28 EDT 2005



jym wrote:

> I would like to modify the page setup prior to printing a document. I 
> naturally thought of using the jslib Prefs object and its methods for 
> this. Having set a series of printing preferences I tried a print and 
> noticed that my code was not effective. Does it mean that this lib is 
> not  intended to modify user preferences dynamically? Or is my code 
> simply erroneous or incomplete:

It should all work. Your code looks fine.

Did you take a look at your prefs.js file to see if these prefs were there?

I use the prefs lib all the time.

--pete

>
> var pref = new Prefs();
>     // Margins.
> pref.setInt("print. print_edge_bottom", 0);
> pref.setInt("print. print_edge_top", 0);
> pref.setInt("print. print_edge_left", 0);
> pref.setInt("print. print_edge_right", 0);
> pref.setInt("print. print_margin_bottom", 0);
> pref.setInt("print. print_margin_top", 0);
> pref.setInt("print. print_margin_left", 0);
> pref.setInt("print. print_margin_right", 0);
>     // Header and footer.
> pref.setChar("print. print_footercenter", "");
> pref.setChar("print. print_footerleft", "");
> pref.setChar("print. print_footerright", "");
> pref.setChar("print. print_headercenter", "");
> pref.setChar("print. print_headerleft", "");
> pref.setChar("print. print_headerright", "");
>
> Some help would be appreciated.
>
> jym
> _______________________________________________
> Jslib mailing list
> Jslib at mozdev.org
> http://mozdev.org/mailman/listinfo/jslib
>
>

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions
tel: 1-719-302-5811
fax: 1-719-302-5813



More information about the Jslib mailing list