public static double[] getMediaDimensions(Media media, LengthUnits units) {
		MediaSize size = media instanceof MediaSizeName ? MediaSize.getMediaSizeForName((MediaSizeName) media) : null;

		if (size == null) {
			size = MediaSize.NA.LETTER;
		}
		return new double[] { units.convert(LengthUnits.IN, size.getX(Size2DSyntax.INCH)), units.convert(LengthUnits.IN, size.getY(Size2DSyntax.INCH)) };
	}