Print margin « Graphics « Java Swing Q&A





1. Printing in Landscape, problem with margins    coderanch.com

Hello I'm trying to print in landscape, and thanks to god it works, BUT i'm having trouble with setting the margins, i managed to set the Top/Button/Right margins with no problem... but i couldnt change the Left one! Using method paper.setImageableArea(16, 16, 805, 951) cuts off the start of the text printed, and the margin is still 1 inch, and i ...

2. Java How to set Printer Margins    coderanch.com

when trying to print using the Print API - the margins seem to be something not in our control!.. Please help me out to set printer margins or is there any way to set margins at Operating system level. By default all the four left, right, top and bottom are set to 1.

3. Printing with Changed Top and Bottom Margins Doesn't Change    coderanch.com

On my little print job with changed margins, I also have a case where I want to print a little bit longer on the page. That is, I wanted to reduce the standard 1 inch maring at Top and Bottom to 3/4 " margins. So I set up the following code in the printjob: Paper pprPap = pf.getPaper(); dblIWid = 468.; ...

4. Set page margins when printing in java    java-forums.org

Alright now I have found this article/code Java Code: import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.awt.print.PageFormat; import java.awt.print.Paper; import java.awt.print.Printable; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; public class MainClass { public static void main(String[] args) throws Exception { PrinterJob pj = PrinterJob.getPrinterJob(); PageFormat pf = pj.defaultPage(); Paper paper = new Paper(); double margin = 9; paper.setImageableArea(margin, margin, paper.getWidth() ...