Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't Java Print API handle paper width that is greater than height?

I'm trying to figure out why the Java Print API can't handle paper sizes where the width is greater than the height. The MediaSize class and all of it's inner classes only have sizes where the height is greater then the width. I am trying to print labels that are 4" x 2" but the print job that I wrote always converts it to 2" x 2" on the paper.

I've found some things online that state that the height must always be greater than the width and have seen in the Java source checks for this with accompanying messages that this is the case but cannot find a reason why.

Does anybody know why this is?

like image 694
jonsinfinity Avatar asked Nov 04 '22 16:11

jonsinfinity


1 Answers

It is true that the paper width must not be greater than the paper heaight (see JavaDoc for MediaSize - description of constructor exception).

This is indeed the question of a paper orientation (i.e. PaperFormat). If you are not able to resolve the problem, the source codes or more exact use-case description might help.

like image 52
Pavel Horal Avatar answered Nov 14 '22 23:11

Pavel Horal