CongUan
asked on
How to set Margins when print with JAVA
Hi Experts,
I need to set page format Margins as below
TopMargins=1
LeftMargins=0
RightMargins=0
BottonMargins=1
Gutter=0
I have not used PageDialog to set this, just want set this in the code not use pageFormat = printJob.pageDialog(pageFo rmat);
But I don't know how to set this wiht PageFormat object in code JAVA.
Please let help me with this.
Thanks in advance!
I need to set page format Margins as below
TopMargins=1
LeftMargins=0
RightMargins=0
BottonMargins=1
Gutter=0
I have not used PageDialog to set this, just want set this in the code not use pageFormat = printJob.pageDialog(pageFo
But I don't know how to set this wiht PageFormat object in code JAVA.
Please let help me with this.
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and then pageFormat.setPaper(yourCu stomizedPa per)
also use Paper.getHeight() .getWidth() to call setImageableArea
default margins are 1 inch (72pt)
default margins are 1 inch (72pt)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yah, Thanks very much.
CongUan ... how come you didn't select my answer which was first and the same as Webstorm
https://www.experts-exchange.com/help.jsp#hi68
https://www.experts-exchange.com/help.jsp#hi68
>> the same as Webstorm
Where did you give those url ?
But i agree you should have received points (maybe a split), and wit h A-grade.
Where did you give those url ?
But i agree you should have received points (maybe a split), and wit h A-grade.
the main solution with needed steps was provided by me