This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Page Orientation Problem with Image getting cut off Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Page Orientation Problem with Image getting cut off" Watch "Page Orientation Problem with Image getting cut off" New topic
Author

Page Orientation Problem with Image getting cut off

Matt Wilcko
Ranch Hand

Joined: Sep 23, 2003
Posts: 65
Hi,
I am currently drawing a jpeg to an 8.5 x 11 page. Problem is that the right hand size of the image doesn't appear(I beleive its due to page borders). To solve this, I tried setting the page orientation to Landscape before drawing. Page is landscape, but even know there is plenty of room, the same part of the image is cut off. Here is the simple code:
pageFormat.setOrientation(0); //set to landscape
Graphics2D g2d = (Graphics2D)g;
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
g2d.drawImage(bufferedImage,0,0,printSizeX,printSizeY,null);

Am I doing something wrong? The width of the image is 554 pixels, if I make it smaller, the entire image appears. I need the full size of 554 pixels though.
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Page Orientation Problem with Image getting cut off