Class CommonUtil

java.lang.Object
org.ofdrw.converter.utils.CommonUtil

public class CommonUtil extends Object
转换工具集合
Since:
2020/8/11
Author:
dltech21
  • 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

      public static float[] doubleArrayToFloatArray(Double[] doubleArray)
    • getPageBox

      public static org.ofdrw.core.basicType.ST_Box getPageBox(org.ofdrw.core.basicStructure.doc.CT_PageArea pageArea, double width, double height)
    • generateTempFilePath

      public static String 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

      public static String convertOfdColorToHtml(org.ofdrw.core.basicType.ST_Array colorArray)
    • matrixFrom

      public static String matrixFrom(org.ofdrw.core.basicType.ST_Array ctms)
    • converJbig2

      public static byte[] converJbig2(File imgFile) throws IOException
      Throws:
      IOException
    • convertV1SignTime

      public static long convertV1SignTime(String time) throws ParseException
      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)
      Parameters:
      colorArray - 颜色数组
      Returns:
      PDF颜色对象