Print Preview (1 of 2, BE and FE)

Detailed Description

Adding the "Print Preview" menu choice, by itself, is trivial. The menu choice will be enabled/disabled in parallel with the existing Print... menu choice. It is unclear whether this menu choice will be available only in Navigator or also in Mail/News, though. The assumption here is that we're adding it to Navigator only.

That menu choice, when enabled, will either open a new "Print Preview" window, or, change the current window to "print preview mode." The former appears at this time to be vastly simpler to implement and is the course we plan to take.

The new (or existing window), is put in "print preview mode" by QI'ing the nsIWebBrowser (or some other object?) for the nsIWebBrowserPrint interface and calling that interface's ShowPrintPreview method. That method returns an nsIPrintPreviewNavigation interface, which then provides the methods that advance through pages, etc.

Unfortunately, that's all in theory. nsIWebBrowserPrint doess not currently declare the method ShowPrintPreview. It appears that this was supposed to be fixed per bug 72691 but that bug was closed (perhaps erroneously). So the method needs to be added, and more importantly, implemented. That would seem to be a "BE" (back end) task.

Once the proper interfaces are in place and implemented, then it should be relatively straightforward to implement the new window. We will implement that window using any simplifying assumptions that can materially reduce the work involved, while not materially reducing the value to the user. For example, it may turn out to be necessary to make the Print Preview window "modal" to the browser window from which it is opened. E.g, if it turns out that subsequent navigation on that parent window raises significant stability issues.

Update 2001 Oct 19

Based on discussions with and input from Rod Spears, it now is looking like "print preview" support in layout will be via a "galley mode" in which the content will be drawn "wysiwyg" with respect to the printer output. Basically, it will look sort of like Adobe Acrobat where the output appears in the window in page-sized chunks with appropriate white background, etc. Opera does print preview this way.

Given this, it seems that we won't need a separate window to display print preview. We will simply change Navigator so that the content area appears in this "galley mode" format. Rather than implementing a new window, the work will entail modifying Navigator so that it works properly in this mode. Those details will not all be known till the back-end layout support is in place. The kind of things we'll have to do include modifying the context menu, preventing user actions that don't make sense (e.g., form submission), and so on.

This flavor of print preview will require less effort: only 9 days instead of 15. The modified task estimates appear below.

Tasks

Issues

Links