Closed
Bug 223821
Opened 22 years ago
Closed 22 years ago
[ps] The environment varibale, MOZ_PRINTER_NAME is not honoured by the browser.
Categories
(Core :: Printing: Output, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: swarna.murthy, Unassigned)
Details
Attachments
(1 file)
User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.5) Gecko/20031020
Build Identifier: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.5) Gecko/20031020
The mozilla browser does not honour the environemnt varibale MOZ_PRINTER_NAME.
Even if this environment varibale is set, it still prints to the default printer
only. This problem is seen on Tru64 UNIX OS. I am not sure on other platforms.
Reproducible: Always
Steps to Reproduce:
1.setenv MOZ_PRINTER_NAME TEST_PRINTER
2.Execute the "mozilla" binary.
3.Load a page. Then choose the "print" menu and print.
It chooses the default printer irrespective of the other printer specified
through the MOZ_PRINTER_NAME env variable.
Actual Results:
Thoguh we want it to print on to "TEST_PRINTER", it still prints to the default
printer.
Expected Results:
It should have printed to "TEST_PRINTER".
File in discussion: "nsPostScriptObj.cpp_org"
Function: nsresult nsPostScriptObj::Init( nsIDeviceContextSpecPS *aSpec )
In this function, the brower gets the name of the
printer. By default, the printer name is,'PostScript/default'.
According to the code flow,the printername obtainted is compared
with the string, "default". If it matches with the string, "default"
then the printername is equated to null.
Also, if the printername is not available, the variable,
"printername" is equated to null. Later, it Construct an environment
string MOZ_PRINTER_NAME=<printername> and adds it to the environment.
(Lines thru 351 - 366)
Given this situation, though the "MOZ_PRITNER_NAME" is set to the
specified printer, the variable,"printername" was always null and
thus, in the printer command,
lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME},
the variable "MOZ_PRINTER_NMAE" was null and hence it used to print
to the default printer.
Now, as a fix, before it sets the "MOZ_PRINTER_NAME" to the
environment, code is added to get the environment variable,
MOZ_PRINTER_NAME. If this is already set, then the same is set back
to the environment otherwise, it is set with the default settings
i.e.,'MOZ_PRINTER_NAME='.
Therefore, it can now honour the MOZ_PRINTER_NAME env variable.
I have attached the fix. Please do the review of the fix.
Thanks,
-Swarna.
Comment 2•22 years ago
|
||
Comment on attachment 134301 [details]
Fix for this bug.
Correct me if I am wrong - the "MOZ_PRINTER_NAME" is set by Mozilla internally
if the user selects any other PostScript/*-printer name than PostScript/default
in the print dialog.
Attachment #134301 -
Flags: review-
Comment 3•22 years ago
|
||
BTW: If you want to have multiple printers in Mozilla's print dialog you may
want to use Mozilla's Xprint module instead (see
http://www.mozilla.org/projects/xprint/ and http://xprint.mozdev.org/) ...
Summary: The environment varibale, MOZ_PRINTER_NAME is not honoured by the browser. → [ps] The environment varibale, MOZ_PRINTER_NAME is not honoured by the browser.
This is the scenario.
We have only the PostScript printer enabled and in
the "Print" Menu, only "PostScript/default" is
available in the "Printer" dialog box.
If the user sets the env variable, "MOZ_PRINTER_NAME"
to the printer name other than the default
postscript printer, the fix (attachment 134301 [details]) is
trying to set the "MOZ_PRINTER_NAME" with the user
specified printer name and hence making it effective
in "Print Command" (i.e.,
"lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}" )
of the "Printer Properties" sub menu.
In all, fix is aiming to prevent the overwriting of
the value of "MOZ_PRINTER_NAME" to a null string.
Thanks,
Swarna.
Comment 5•22 years ago
|
||
I'm with comment #2. MOZ_PRINTER_NAME isn't intended to be set by the user. It's
a method for mozilla to communicate the printer name to the process that's
receiving the print job. I consider the method to be a hack, and I hope to
remove it eventually.
If you want to communicate a user-specified printer name to the printing
subsystem, you just need to use a different environment variable. Lpr software
generally recognizes PRINTER as the default print queue, or you can use the same
hack that mozilla uses only with a different variable:
lpr ${MYPRINTER:+'-P'}${MYPRINTER}
I recommend resolving this WONTFIX.
Comment 6•22 years ago
|
||
There has been no further discussion. I'm resolving this per the previous comment.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•