Default Values Ignored for print margins
Hello,
When attempting to assign defaults in a prefs.js file (I just created allprefs.js in defaults\pref) a few are ignored. After experiencing the issue mentioned here: https://support.mozilla.org/en-US/questions/974199?esab=a&as=aaq&page=2 across our company, we're trying to get these settings straightened out.
allprefs.js contains the following lines:
pref("print.print_bgimages", "");
pref("print.print_bgcolor", true);
pref("print.print_footerleft", "");
pref("print.print_footerright", "");
pref("print.print_footercenter", "");
pref("print.print_headerleft", "");
pref("print.print_headerright", "");
pref("print.print_shrink_to_fit", false);
pref("print.print_scaling", "1.00");
pref("print.print_margin_top", "0");
pref("print.print_margin_bottom", "0");
pref("print.print_margin_right", "0");
pref("print.print_margin_left", "0");
Everything sticks except for the print_margin_* settings. They will only work if I explicitly assign them to a printer, as in: pref("print.printer_myprintername.print_margin_top", "0"); The issue here is that printer names are not going to be consistent across the board, so I really need a print.print_ option that applies settings to whichever printer the user happens to have selected.
As an aside, a user.js or prefs.js edit is really out of the question, as scripting entries into a randomly named directory would take a lot more time than this is worth.
Modificado por cor-el a
Todas as respostas (3)
I have to bump this.
Is there really no way to set global print settings in Firefox? I've looked into using sed to just modifying the existing lines that have a printer defined, but randomly generated profile names prevent me from even entering the directory.
Instead of the "print.print_ ...." preferences such as this:
pref("print.print_bgimages", "");
try using prefs like this "print_bgimages"
Firefox 5.0 and earlier versions used the print.print_ ... preferences, while 6.0 and later use print_ ... preferences.
https://support.mozilla.org/en-US/kb/fix-printing-problems-firefox#w_reset-firefox-printer-setting
edmeister,
Thank you for the excellent answer. I have to admit that these preference schemas are a bit odd. In your specific example for background images, that schema is incorrect. print.print_bgimages works, while just print_bgimages does not. For margins specifically however, your schema is correct and changing print.print_margin_right to just print_margin_right works fine. Mozilla really makes me scratch my head sometimes, but I really do appreciate your help on this issue.