Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to print a formpage?
How to print a formpage? [message #290629] Sun, 28 August 2005 13:12 Go to next message
Eclipse UserFriend
Originally posted by: Langerjo.de.ibm.com

Hi @ all,

am i stupid but i don't know how to print a simple formpage. I
implmented a printing action. but I don't know how to paint the widgets
with the gc object. How can I print SWT widgets?

My code so far:

PrintDialog pd = new PrintDialog(LowSummaryPage.this.getSite().getShell());
PrinterData printerData = pd.open();
if (printerData != null) {
Printer printer = new Printer(printerData);
if (printer.startJob("SWT Printing Snippet")) {
if (printer.startPage()) {
GC gc = new GC(printer);

//What to do here???
printer.endPage();
printer.endJob();
gc.dispose();
}
}
}


I hope anyone can help. I don't find any resources how to print some
widgets diplayed on my page, only how to draw text or rectangles:(((


Thanks, Johannes
Re: How to print a formpage? [message #290639 is a reply to message #290629] Mon, 29 August 2005 08:38 Go to previous message
Eclipse UserFriend
Originally posted by: newsgroups.pellaton.li

Hi

Unlike other Widget toolkits, SWT does not support the painting on other
contexts than the screen. I implemented printing using the image copy
functionality (however, it's very limited).

http://dev.eclipse.org/viewcvs/index.cgi/platform-swt-home/f aq.html

Another possibility is to print out all data needed by drawing on the
grapics context of the printer.

http://www.java2s.com/ExampleCode/SWT-JFace-Eclipse/PrintDia logExample.htm

Hope this helps

Michael
Previous Topic:Properties / Categories question
Next Topic:Dynamic ProblemMarkers
Goto Forum:
  


Current Time: Tue Apr 23 17:23:54 GMT 2024

Powered by FUDForum. Page generated in 0.02851 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top