List of usage examples for com.itextpdf.text Utilities pointsToMillimeters
public static final float pointsToMillimeters(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 w w w .ja v a2 s.co 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; }