Community
Participate
Working Groups
In order to better support the customer it is desirable that the File menu has a Print Preview menu item in addition to the Print menu item. This would allow the users to ensure they are printing what they want.
Good idea - anyone in the open source community want to implement this? We will not have time to consider this for 2.0
Reopened for investigation
Created attachment 8320 [details] Screenshot of Simple Print Preview
I put together a simple print preview framework that I'm using in the application I'm building. Here is a summary of what I did: New Classes ----------- - Previewer This class is the main class, it takes a Printer and Display in the constructor. It basically creates a temporary image that is the current print preview page scaled to the display's DPI. It implements all the org.eclipse.swt.Printer public APIs against the image. - PrintListener - PrintEvent This event listener provides a callback mechanism to notify a ui that state changed of the print job or current page. The event carries what changed (ie. start of a new page, end of a new page) and the image representing the current page before the call completes. It is up to the implementor of the event listener interface to decided what to do (this usually involves copying the image and scaling to fit onto a UI control). Drawbacks ----------- The font size and spacing could change dramatically when the font is on the printer device versus the display device. I was hoping to implement a new type of GC that can take these differences into consideration when writing text between the printer and device, but GC is tied into everything. I've submitted a screenshot (the top control is a StyledText and the bottom one displays the image of the current print preview page). Hope this helps
How hard would it be to make this PrintPreview usable in GEF? Basically I would like to be able to view the drawing that will be printed based on the PrintFigureOperation flags FIT_HEIGHT, FIT_PAGE, etc. Also be able to see multiple pages of the drawing if the drawing is split into multiple pages; like a "Next Page" button. I know this enhancement is for text printing, but will it be flexible and rich enough to also do the graphics from GEF? thanks, Barry
Re-assigning to Nick to bring it out of the inbox.
We have no plans to address this for 3.1.
will this be considered for 3.2?
There are no plans to address this for 3.2. Proper support for print preview would require some support from SWT, such as a PrintPreview device (see comments above). Adding the menu item at Workbench or IDE level is easy.
I'm pretty sure this belongs in a layer above SWT, with SWT providing the missing API as appropriate. Nick?
... the PrintPreview device doesn't seem platform specific.
Assigning to component owner PW
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.