Class CommonUtil
java.lang.Object
org.ofdrw.converter.utils.CommonUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]converJbig2(File imgFile) static doubleconverterDpi(double len) static com.itextpdf.kernel.colors.ColorconvertOfdColor(org.ofdrw.core.basicType.ST_Array colorArray) Deprecated.static StringconvertOfdColorToHtml(org.ofdrw.core.basicType.ST_Array colorArray) static org.apache.pdfbox.pdmodel.graphics.color.PDColorconvertPDColor(org.ofdrw.core.basicType.ST_Array colorArray) static longconvertV1SignTime(String time) static float[]doubleArrayToFloatArray(Double[] doubleArray) static doubledpiToPpm(int dpi) 获取指定DPI下的每毫米像素数量static Stringstatic org.ujmp.core.MatrixgetImageMatrixFromOfd(org.ofdrw.core.basicStructure.pageObj.layer.block.ImageObject nImageObject, org.ofdrw.core.basicType.ST_Box pageBox) static org.ujmp.core.MatrixgetImageMatrixFromOfd(org.ofdrw.core.basicStructure.pageObj.layer.block.ImageObject nImageObject, org.ofdrw.core.basicType.ST_Box pageBox, org.ofdrw.core.basicType.ST_Array compositeObjectCTM) static org.ofdrw.core.basicType.ST_BoxgetPageBox(org.ofdrw.core.basicStructure.doc.CT_PageArea pageArea, double width, double height) static StringmatrixFrom(org.ofdrw.core.basicType.ST_Array ctms) static doublemillimetersToPixel(double mm, double dpi) static doublepixelToMillimeters(double px, double dpi) static org.apache.pdfbox.util.MatrixtoPFMatrix(org.ujmp.core.Matrix source)
-
Constructor Details
-
CommonUtil
public CommonUtil()
-
-
Method Details
-
millimetersToPixel
public static double millimetersToPixel(double mm, double dpi) -
pixelToMillimeters
public static double pixelToMillimeters(double px, double dpi) -
dpiToPpm
public static double dpiToPpm(int dpi) 获取指定DPI下的每毫米像素数量- Parameters:
dpi- 每英寸的像素 如200、300- Returns:
- 像素每毫米
-
doubleArrayToFloatArray
-
getPageBox
public static org.ofdrw.core.basicType.ST_Box getPageBox(org.ofdrw.core.basicStructure.doc.CT_PageArea pageArea, double width, double height) -
generateTempFilePath
-
converterDpi
public static double converterDpi(double len) -
convertPDColor
public static org.apache.pdfbox.pdmodel.graphics.color.PDColor convertPDColor(org.ofdrw.core.basicType.ST_Array colorArray) -
convertOfdColorToHtml
-
matrixFrom
-
converJbig2
- Throws:
IOException
-
convertV1SignTime
- Throws:
ParseException
-
getImageMatrixFromOfd
public static org.ujmp.core.Matrix getImageMatrixFromOfd(org.ofdrw.core.basicStructure.pageObj.layer.block.ImageObject nImageObject, org.ofdrw.core.basicType.ST_Box pageBox, org.ofdrw.core.basicType.ST_Array compositeObjectCTM) -
getImageMatrixFromOfd
public static org.ujmp.core.Matrix getImageMatrixFromOfd(org.ofdrw.core.basicStructure.pageObj.layer.block.ImageObject nImageObject, org.ofdrw.core.basicType.ST_Box pageBox) -
toPFMatrix
public static org.apache.pdfbox.util.Matrix toPFMatrix(org.ujmp.core.Matrix source) -
convertOfdColor
@Deprecated public static com.itextpdf.kernel.colors.Color convertOfdColor(org.ofdrw.core.basicType.ST_Array colorArray) Deprecated.- Parameters:
colorArray- 颜色数组- Returns:
- PDF颜色对象
-
ColorConvert.pdfRGB(ResourceManage, CT_Color)