Printing and Page Setup Status


I have created a patch for many needed changes for Printing in order to support an XP Dialog in Windows, to better integrate nsIPrintSettings/nsIPrintOptions, and to support Page Setup.
The table below describes the decisions and status of the Printing/Prnit Dialog work.

#
Issue
Status
Engineer
Comments
1
Finish the nsIPrintSettings interface
80% complete??
rods
Freeze the API during  Milestone 0.99
2
Change the Embedding APIs to nsIPrintSettings
100% complete
rods

(previous checkin)
3
Enable each Browser window to have its own nsIPrintSettings object that used for Page Setup, PrintPreview, and Printing
100%
(Patch)
rods

The patch enables this for Mozilla and MFCEmbed. Mozilla gets one from the nsIPrintOptions in the browser.js. Embedders can get a copy from the nsIWebBrowserPrint interface and can implement their own if the wish.
4
Provide a "base" or minimal implementation for nsIPrintSettings
100%
(Patch)
rods

Patch. The nsIPrintOptions has a new method called CreatePrintSettings.  The impl of nsIWebBrowserPrint  gets a new object from the nsIPrintOptions.
5
Reduce the scriptable interface of nsIPrintOption, everyone should switch over to use nsIPrintSettings
0%
rods

This will have to wait until the Linux "printjoboption" dialog is switched over to use nsIPrintSettings and this dialog should only support Linux specific settings not covered in the generic Page Setup dialog (see item #6).

Unless we need to support other options the only options/methods that will be scriptable are:
  1. printSettings - this set/gets the current setting from the nsIPrintOptions object to the PrintSettings
  2. availablePrinters - This enables callers to enumerate the available printers at runtime.
  3. CreatePrintSettings - this creates a new PrintSettings object
And these are only to support our current implementation of Mozilla which uses the nsIContentViewerFile interface. Embedders will use the nsIWebBrowserPrint interface and should not have any references to nsIPrintOptions.

Any and all intformation needed for printing will be available thru the nsWebBrowserPrint interface or nsIWebBrowserPrintDialog interface (see items #18 & #20)
6
Convert Linux PrintJobOptions dialog over to use nsIPrintSettings and support only Linux specific options
100%
rods
This work should also include the removal of the paperType attribute (See item #13)

(OS2 and other OSs need to be converted also)
7
Add Page Setup to Mozilla File menu
100%
Patch
rods

Patch
8
Add Page Setup Dialog to Mozilla
100%
Patch
rods

The Page Setup dialog being checked in with the patch was taken from the "PrintJobOptions" dialog for Linux.
9
Complete the Page Setup dialog
50%?
phcen
The items that need to be added are: Background Images, Back Colors, Headers, Footer, change Paper Size to a combobox., Page Scaling (see the Page Setup Dialog in MFCEmbed)
10
Create an XP Printer Dialog
100%
Linux Dev
This was completed and checked by the Linux devlopers. It supports print to the available printers and printing to a file. (See comments on item #11)
11
Enable Windows to use a Native Print Dialog or XP Dialog.
100%
Patch
rods
Move the native print dialog from nsDeviceContextSpecFactoryW.cpp to nsDeviceContextSpecWin.cpp like the other platforms. Also, enabled it so at runtime we can use either the native or the XP Dialog.

NOTE: The Linux dialog uses the "Properties" button to print up the printjoboptions dialog, which I feel should really be a platform/print specific dialog. This has been changed on Windows to popup a native Advanced Document Properties dialog. (For now it display a Document Prop Dialog because of a bug I am investigating)
12
Enable the switching between the Native print dialog and the XP dialog.
100%
Patch
rods
The is available in Mozilla via the Prefs Dialog Debug item. A new checkbox has been added to indicate whether you want to use the native or XP Dialog.
13
Remove Paper Sizes from nsIPrintOptions
100%
Patch
rods
Instead of having a set of static enums for specifying the paper sizes, we have decided to change the API (nsIPrintOptions and nsIPrintSettings) to have 5 new items:
  1.   attribute double  paperWidth;    /* width of the paper in inches or mm */
  2.   attribute double  paperHeight;   /* height of the paper in inches or mm */
  3.   attribute short   paperSizeUnit; /* paper is in inches or mm */
  4.   attribute short   paperData ;     /* native data value */
  5.   attribute short   paperSizeType; /*  use native data or is defined here */

Instead of havnig a "page size" enumerator, we decided to enable two things:
  1. The ability to set native data that can a value indicating a platform specific enum. This is optional, but comes in handy on Windows which specifies over 110 different paper sizes depending on the OS version and localization.
  2. To set a defined paper size. This enables the UI to offer any number of paper sizes and the UI merely needs to set the selected paper width and height into the nsIPrintSetting API and the platform will "map" to a platform specified paper size or use it as a user defined paper size.
NOTE: The current paper size enums and paperType are still avilable but have been deprecated and will have to be removed on Linux.
14
Add Additional Items to MFCEmbed Page Setup Dialog
100%
Patch
rods
With the patch all available options will be reflected in the Page Setup for MFCEmbed (see item #9)
15
Rename nsIPrintOptions::printer to nsIPrintOptions::printerName
100%
Patch
rods
This needed to be renamed because the IDL generates a call "GetPrinter" which conflicts with the native Windows API and therefore will not compile.
16
The Mac platform needs to get all the Printing options from the PrintService
?
dcone
Someone needs to verfiy that the Mac is using all available print settnig/options.
17
Enumerate the current printers on a platform
Linx: 100%
Win: 100%
Patch
Mac: 0%
dcone
Being able to enumerate the current list of printers is need for support the XP Dialog or enabling embedders to create their dialog.

The original work for Linux was done previously and checked in. I have completed the work for Windows. No work has been done for Mac.
#18
PrintDialogService
0%
rods
Problem: The print dialog needs to be "pop up" during the printing process and it needs receive special information that was constructed during the initial part of setting everything up for printing (document state etc.) and then return some information back to printing.

Requirement: To create a Print Dialog Service patterned after the Prompt-Service so embedders can create their own print dialogs (Print, PageSetup, Print Progress, Preview Progress)
#19
XP Print/PrintPreview Progress Dialog
0%
pchen
Create a Print and Print Preview progress dialog that recieves nitifications thru the nsIPrintListener interface. The dialog itself may need to come frmo the PrintDialogService
#20
Remove most all usages of nsIPrintOption and have the DocumentViewer use PrintSettings for all printing.
100%
patch
rods
Currently, the PrintOptions is used for printing tasks and if two large documents were printed at the same time the titles, url, and other options would get corrupted.