Closed Bug 299129 Opened 19 years ago Closed 13 years ago

fails to enumerate all printers on Mac OS X through nsIPrintOptions.availablePrinters() in javascript

Categories

(Core Graveyard :: GFX: Mac, defect)

PowerPC
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: hugh.liu, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+

In my extension, I try to enumerate all printers through
nsIPrintOptions.availablePrinters, but such exception is thrown on Mac OS X.

[Exception... "Component returned failure code: 0x80040154
(NS_ERROR_FACTORY_NOT_REGISTERED) [nsIPrintOptions.availablePrinters]" 
nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)"  location: "JS frame ::
chrome://catcher/content/printerdialog.js :: onLoad :: line 10"  data: no]

The same code works on Linux/Windows XP

Also, if printing to file does not works on
Mac(nsIPrintSettings.printToFile=true).Even it I set current nsIPrintSettings to
printToFile and toFileName, the output still is sent to printer instead of file.
 But the same code works well on Linux/Windows XP.  


Reproducible: Always

Actual Results:  
Exception thrown. 
[Exception... "Component returned failure code: 0x80040154
(NS_ERROR_FACTORY_NOT_REGISTERED) [nsIPrintOptions.availablePrinters]" 
nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)"  location: "JS frame ::
chrome://catcher/content/printerdialog.js :: onLoad :: line 10"  data: no]

Expected Results:  
availablePrinters() and printToFile works on Mac OS X, just as Linux/Windows XP.
Severity: normal → major
Version: Trunk → 1.7 Branch
Mac doesn't have a class for NS_PRINTER_ENUMERATOR_CID

Note that a lot of the printing stuff is not really implemented on mac from what I can see, since a lot of it is handled by the OS instead.
Assignee: printing → joshmoz
Status: UNCONFIRMED → NEW
Component: Printing → GFX: Mac
Ever confirmed: true
QA Contact: mac
Version: 1.7 Branch → Trunk
Blocks: 301444
Assignee: joshmoz → nobody
Product: Core → Core Graveyard
Filed bug 675709 on the printToFile issue.
I am WONTFIXing this because the "modern" printing APIs on OSX (and all other supported platforms) strongly discourage enumeration of all available printers, and accordingly, nsIPrinterEnumerator (which replaced nsIPrintOptions.availablePrinters) is being removed in bug 629500.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.