Results 1 to 3 of 3
Thread: Printing a scalled Component
- 03-30-2011, 07:22 PM #1
Printing a scalled Component
I have a problem with printing a component or a set of components, I only need to print 1 page for the current print job, this works but parts of the page are cut off because the component is too large for the page.
If anyone has any insight on this with example code etc. would be greatly appreciated.
- 03-31-2011, 04:57 AM #2
Senior Member
- Join Date
- Jan 2009
- Posts
- 671
- Rep Power
- 5
I would recommend using the 'scale' method of Graphics2D to scale it to fit the page. The scale factors are:
sx = (double) pageWidth / getBounds().width
sy = (double) pageHeight / getBounds().height
(where pagewidth and pageheight account for margins and are obtained from the PrintJob)
- 04-05-2011, 04:35 AM #3
Similar Threads
-
printing string backwards and printing every other
By droidus in forum New To JavaReplies: 22Last Post: 03-10-2011, 09:17 AM -
add(component) gives 2 components?
By warchieflll in forum Advanced JavaReplies: 2Last Post: 01-31-2011, 03:08 PM -
Component to use ?
By pbaudru in forum AWT / SwingReplies: 2Last Post: 02-17-2010, 09:55 AM -
the component does not show
By shruti in forum AWT / SwingReplies: 8Last Post: 07-08-2009, 12:21 PM -
add component to component
By Omarero in forum New To JavaReplies: 7Last Post: 05-17-2009, 02:39 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks