发表于: 2006.07.12 22:04
分类: Java
出处: http://looric.itpub.net/post/5065/139935
---------------------------------------------------------------
You can monitor this bug on the Java Bug Database at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6448286.
If you are a member of the Sun Developer Network (SDN),Please Vote for the bug Click http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6448286.
在java中有个包,设置打印纸的大小的时候会用到。它有一个比较奇怪的假设,就是打印纸的宽度(x)必须小于其长度(y)。但是实际上,有些情况下,会出现宽度大于高度的情况。比如说9.5"x11"/2 (241mm 压感打印纸)。这种纸的宽度是9.5",高度是5.5”,
但是你没有办法设置成这样的高度。或许有人会说,调整打印方向就可以了。但是这种纸,是连续的,两边有孔的,你装在针式打印机上,除了竖向打印,是没有其它办法的。所以说这个class的x > y条件是有问题的。
MediaSize
public MediaSize(int x,
int y,
int units,
MediaSizeName media)- Construct a new media size attribute from the given integer values.
- Parameters:
x- X dimension.y- Y dimension.units- Unit conversion factor, e.g.Size2DSyntax.INCHorSize2DSyntax.MM.media- a media name to associate with this MediaSize- Throws:
IllegalArgumentException- (Unchecked exception) Thrown ifx< 0 ory< 0 orunits< 1 orx>y.
http://java.sun.com/javase/6/docs/api/javax/print/attribute/standard/MediaSize.html
java.lang.IllegalArgumentException: X dimension > Y dimension
at javax.print.attribute.standard.MediaSize.
at org.compiere.print.MPrintPaper.getMediaSize(MPrintPaper.java:147)
at org.compiere.print.MPrintPaper.getCPaper(MPrintPaper.java:189)
at org.compiere.print.layout.LayoutEngine.setPrintFormat(LayoutEngine.java:174)
at org.compiere.print.layout.LayoutEngine.
at org.compiere.print.ReportEngine.layout(ReportEngine.java:173)
at org.compiere.print.ReportEngine.getView(ReportEngine.java:251)
at org.compiere.print.Viewer.
at org.compiere.print.ReportCtl.startDocumentPrint(ReportCtl.java:162)
at org.compiere.print.ReportCtl.start(ReportCtl.java:61)
at org.compiere.apps.ProcessCtl.run(ProcessCtl.java:272)
javax.print.attribute.standard
Class MediaSize
java.lang.Object |_javax.print.attribute.Size2DSyntax |_javax.print.attribute.standard.MediaSize
java.lang.IllegalArgumentException: X dimension > Y dimension
at javax.print.attribute.standard.MediaSize.











