Printing Gantt Chart - best approach? [message #870480] |
Tue, 08 May 2012 11:47 |
Mike Evans Messages: 237 Registered: July 2009 |
Senior Member |
|
|
Hi All,
I have just discovered Emil Crumhorn's excellent Gantt chart widget (yes - I do not visit the Nebula home page all that often).
I am looking to embed it in my app and offer a print option.
Enbedding is easy enough - Emil's API's are straightforward.
However I am not very familiar with SWT printing so I am seeking advice on the best approach.
I can think of three:
1) 'Conventional' SWT - use Control.print(...)
Pseudo-code:
Printer p = new Printer(..);
p.startJob()
p.startPage()
GC gc = new GC( p );
ganttChart.print( gc ); // as it extends Control
// tidy up
2) Create and print a screenshot image:
Pseudo-code:
// get screenshot
Image i = new Image( Display.getCurrent(), ganttChart.getSize().x, ...y );
GC gc = new GC( ganttChart );
gc.copyArea( i, 0, 0 );
// copy to print image
Printer p = new Printer(..);
Image pi = new Image( p, i.getImageData() );
GC pgc = new GC( p );
pgc.drawImage( pi, .. );
// tidy up
3) Use PaperClips
Pseudo-code: ?
The first two will only print what is displayed on screen and I am not sure how to ensure all the hidden (ie scrollable) content is included. Moreover I am sure I will also have scaling and pagination issues.
The PaperClips library offers help with such issues but how complex is it to develop the necessary 'Print' interface implementation for such a complex GUI widget?
Any advices, ideas, alternatives?
Many thanks,
Mike E.
-
|
|
|
Powered by
FUDForum. Page generated in 0.03793 seconds