Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Trouble with margins when printing
Trouble with margins when printing [message #466724] Mon, 16 January 2006 23:13 Go to next message
Eclipse UserFriend
Originally posted by: wmoran.potentialtech.com

I'm fairly new to Java, SWT and Eclipse. This is my first post.

I'm trying to print using a StyleedText object (which seems to be the
recommended way of printing) but I'm getting hung up on what looks like
a problem with margins. I'm developing on the Windows platform.

My target printer is a special label printer that prints 1 label at a time.
Each label is 4"x1.5". Querying the printer from within the app tells me
I have 812x302 pixels.

The problem is that I can't seem to print anything without (what appear to
be) 1" margins on the top and left side. With such small labels, this
runs me short of space very quickly. The special label printer (a Zebra,
in case anyone is curious) is cabable of printing right to the edge of the
label on all four sides. I have other appd (written in FoxPro, which I'd
like to eventually migrate to Java) which print fine.

If I switch my default printer to a typical 8 1/2 x 11 printer, I still get
(what appear to be) 1" margins all around.

Possibly, I'm not very skilled with search engines ;) but I can't seem to
find any reference to this at all. I can't imagine it's the printer
settings, as other applications work without problem.

Anyone have any suggestions on how to coax a StyledText object into printing
with zero" margins on all sides?

--
Bill Moran
Potential Technologies
http://www.potentialtech.com
Re: Trouble with margins when printing [message #466811 is a reply to message #466724] Tue, 17 January 2006 20:26 Go to previous messageGo to next message
Felipe Heidrich is currently offline Felipe HeidrichFriend
Messages: 29
Registered: July 2009
Junior Member
StyledText always set one inch margin around the client area (1), not
configurable (maybe you file a bug about this in our bugzilla).
But in your case it sounds probably easier to get a gc and draw what you
need by hand.

Thanks
Felipe

(1) see StyledText.Printing.init()
Re: Trouble with margins when printing [message #466816 is a reply to message #466811] Tue, 17 January 2006 21:35 Go to previous message
Eclipse UserFriend
Originally posted by: wmoran.potentialtech.com

felipe_heidrich@ca.ibm.com (Felipe Heidrich) wrote:

> StyledText always set one inch margin around the client area (1), not
> configurable (maybe you file a bug about this in our bugzilla).

I should. Whether or not it's a bug, it's certainly a restricting
limitation.

> But in your case it sounds probably easier to get a gc and draw what you
> need by hand.

I found an example of using gc for that earlier today and was able to get
what I needed. Based on the simplicity of my requirement, though, using
a StyledText object would have been about 10 lines shorter than using
gc. The only thing that made the StyledText object unusable was the
margin issue.

Thanks for the feedback.

--
Bill Moran
Potential Technologies
http://www.potentialtech.com
Previous Topic:Disabled icon palettes
Next Topic:CheckboxTableViewer: set the checkboxes programmatically
Goto Forum:
  


Current Time: Fri May 24 17:15:49 GMT 2019

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

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

Back to the top