<div dir="ltr">Hi JavaFX Developer!<br><br>The Problem:<br><br>On the class <a href="http://java.print.Page">java.print.Page</a>, the methods “getWidth" and “getHeight" don’t return the correct values.<br><br>Especially it causes problems when the Paper is defined in mm.<br>This happens mainly because of this method, which rounds down to full points:<br><br>private double getSizeInPoints(double dim) {<br>    switch (units) {<br>    case POINT : return (int)(dim+0.5);<br>    case INCH  : return (int)((dim * 72) + 0.5);<br>    case MM    : return (int)(((dim * 72) / 25.4) + 0.5);<br>    }<br>    return dim;<br>}<br><br>This causes problem because it makes correct computations based on the Paper impossible.<br>So it’s basically not possible to get the size of any Paper which is defined based on mm.<br><br>There I suggest 3 solutions:<br><br>Solution1:<br>We could just change getSIzeInPoints to return the exact value.<br>Advantage: Might fix various unknown bugs in user code.<br>Disadvantage: Might cause regressions.<br><br>Solution2:<br>We could add new methods getExactWidth() / getExactHeight() , which returns the exact value without a rounding problem anywhere noticeable.<br><br>Solution3:<br>We could provide an API to access the width/height based on a given Unit.<br>like: getWidth(Unit.MM).<br>We already have implemented this, in our application code, so it wouldn’t be much effort.<br>But it would require moving com.sun.javafx.print.Units back to javafx.print.Paper.Units. (basically reverting JDK-8093699)<br><br><br>Summary:<br>I am happy with every solution.<br>I’m a bit in favor of 1, but 2 and 3 is also ok for me.<br>It would be great if someone could make a decision on which solution to choose, then i would provide a PR.<br><br>Greetings Florian Kirmaier<br></div>