List of usage examples for com.itextpdf.text Utilities pointsToInches
public static final float pointsToInches(final float value)
From source file:net.sf.mzmine.util.DimensionUnitUtil.java
License:Open Source License
/** * Converts a pixel size to the given unit * /*from ww w . j a v a 2 s . c o m*/ * @param val * @param unit * @return Float.NaN if the no conversion was defined for this unit */ public static float getSizeInUnit(float value, DimUnit unit) { switch (unit) { case CM: return Utilities.pointsToMillimeters(value / 10.f); case MM: return Utilities.pointsToMillimeters(value); case INCH: return Utilities.pointsToInches(value); case PX: case PT: return value; } return Float.NaN; }