Community
Participate
Working Groups
Here's the hello world printing snippet modified to be in mirrored mode: Display display = new Display(); PrinterData data = Printer.getDefaultPrinterData(); if (data == null) { System.out.println("Warning: No default printer."); return; } Printer printer = new Printer(data); if (printer.startJob("SWT Printing Snippet")) { Color black = printer.getSystemColor(SWT.COLOR_BLACK); Color white = printer.getSystemColor(SWT.COLOR_WHITE); Color red = printer.getSystemColor(SWT.COLOR_RED); Rectangle trim = printer.computeTrim(0, 0, 0, 0); Point dpi = printer.getDPI(); int leftMargin = dpi.x + trim.x; // one inch from left side of paper int topMargin = dpi.y / 2 + trim.y; // one-half inch from top edge of paper GC gc = new GC(printer, SWT.RIGHT_TO_LEFT); Font font = gc.getFont(); // example just uses printer's default font if (printer.startPage()) { gc.setBackground(white); gc.setForeground(black); String testString = "Hello World!"; Point extent = gc.stringExtent(testString); gc.drawString(testString, leftMargin, topMargin + font.getFontData()[0].getHeight()); gc.setForeground(red); gc.drawRectangle(leftMargin, topMargin, extent.x, extent.y); printer.endPage(); } gc.dispose(); printer.endJob(); } printer.dispose(); display.dispose();
Any chance of this getting fixed for 3.1?
It worked here. It printed, in the top-right corner of the page, the text "! Hello World" and a box around it. What output did you get ?
I get right alignment, but I am seeing: "Hello World!"
So this is like Bug 94496 but in the printer ?
Hmm, it seems this is printer dependent. On one printer I see what you see, except the string is "Hello World!" instead of "!Hello World". Randy's getting the same output on that printer. On another printer, I am seeing this (along the left edge of the paper): ------------- | |Hello World! -------------
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
This is a one-off bulk update. (The last one in the triage migration). Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process: https://wiki.eclipse.org/SWT/Devel/Triage See Bug 518478 for details. Tag for notification/mail filters: @TriageBulkUpdate
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. -- The automated Eclipse Genie.