Class PointUtil

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

public class PointUtil extends Object
Since:
2020/8/11
Author:
dltech21
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    adjustPos(double width, double height, double x, double y, org.ofdrw.core.basicType.ST_Box boundary)
     
    static List<PathPoint>
    calPathPoint(List<PathPoint> abbreviatedPoint)
     
    static double
    calPdfPathLineWidth(double lineWidth, double scale, boolean legacyAbsolutePath, org.ofdrw.core.basicType.ST_Array ctm)
    Converts an OFD path line width to PDF points.
    static List<PathPoint>
    calPdfPathPoint(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, List<PathPoint> abbreviatedPoint, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean fixOriginToPdf)
     
    static List<PathPoint>
    calPdfPathPoint(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, List<PathPoint> abbreviatedPoint, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean fixOriginToPdf, double scale)
     
    calPdfTextCoordinate(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, float fontSize, List<org.ofdrw.core.text.TextCode> textCodes, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, boolean fixOriginToPdf, double scale)
     
    calPdfTextCoordinate(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, float fontSize, List<org.ofdrw.core.text.TextCode> textCodes, List<org.ofdrw.core.text.CT_CGTransform> cgTransforms, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, boolean fixOriginToPdf)
     
    calPdfTextCoordinate(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, float fontSize, List<org.ofdrw.core.text.TextCode> textCodes, List<org.ofdrw.core.text.CT_CGTransform> cgTransforms, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, boolean fixOriginToPdf, double scale)
     
    calTextPoint(List<org.ofdrw.core.text.TextCode> textCodes)
     
    static org.ofdrw.core.basicType.ST_Box
    combineBoundary(org.ofdrw.core.basicType.ST_Box parentBoundary, org.ofdrw.core.basicType.ST_Box childBoundary)
    将子图元的外接矩形转换到父图元坐标系。
    static List<PathPoint>
    解析压缩路径为点坐标
    static double[]
    ctmCalPoint(double x, double y, Double[] ctm)
     
    static boolean
    isLegacyAbsolutePath(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, List<PathPoint> points, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm)
    Detects the absolute 300 DPI path coordinates used by pre-standard Foxit OFD files.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PointUtil

      public PointUtil()
  • Method Details

    • convertPathAbbreviatedDatatoPoint

      public static List<PathPoint> convertPathAbbreviatedDatatoPoint(String abbreviatedData)
      解析压缩路径为点坐标
      Parameters:
      abbreviatedData - 压缩路径
      Returns:
      绘制点坐标序列
    • calPathPoint

      public static List<PathPoint> calPathPoint(List<PathPoint> abbreviatedPoint)
    • calTextPoint

      public static List<TextCodePoint> calTextPoint(List<org.ofdrw.core.text.TextCode> textCodes)
    • adjustPos

      public static double[] adjustPos(double width, double height, double x, double y, org.ofdrw.core.basicType.ST_Box boundary)
    • combineBoundary

      public static org.ofdrw.core.basicType.ST_Box combineBoundary(org.ofdrw.core.basicType.ST_Box parentBoundary, org.ofdrw.core.basicType.ST_Box childBoundary)
      将子图元的外接矩形转换到父图元坐标系。
      Parameters:
      parentBoundary - 父图元外接矩形
      childBoundary - 子图元在父图元坐标系中的外接矩形
      Returns:
      子图元在页面坐标系中的外接矩形
    • ctmCalPoint

      public static double[] ctmCalPoint(double x, double y, Double[] ctm)
    • isLegacyAbsolutePath

      public static boolean isLegacyAbsolutePath(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, List<PathPoint> points, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm)
      Detects the absolute 300 DPI path coordinates used by pre-standard Foxit OFD files. Their declared CTM places the complete path outside its Boundary, while interpreting the raw coordinates as 300 DPI device coordinates places it inside the Boundary.
    • calPdfPathLineWidth

      public static double calPdfPathLineWidth(double lineWidth, double scale, boolean legacyAbsolutePath, org.ofdrw.core.basicType.ST_Array ctm)
      Converts an OFD path line width to PDF points.
    • calPdfPathPoint

      public static List<PathPoint> calPdfPathPoint(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, List<PathPoint> abbreviatedPoint, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean fixOriginToPdf)
    • calPdfPathPoint

      public static List<PathPoint> calPdfPathPoint(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, List<PathPoint> abbreviatedPoint, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean fixOriginToPdf, double scale)
    • calPdfTextCoordinate

      public static List<TextCodePoint> calPdfTextCoordinate(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, float fontSize, List<org.ofdrw.core.text.TextCode> textCodes, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, boolean fixOriginToPdf, double scale)
    • calPdfTextCoordinate

      public static List<TextCodePoint> calPdfTextCoordinate(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, float fontSize, List<org.ofdrw.core.text.TextCode> textCodes, List<org.ofdrw.core.text.CT_CGTransform> cgTransforms, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, boolean fixOriginToPdf)
    • calPdfTextCoordinate

      public static List<TextCodePoint> calPdfTextCoordinate(double width, double height, org.ofdrw.core.basicType.ST_Box boundary, float fontSize, List<org.ofdrw.core.text.TextCode> textCodes, List<org.ofdrw.core.text.CT_CGTransform> cgTransforms, org.ofdrw.core.basicType.ST_Box compositeObjectBoundary, org.ofdrw.core.basicType.ST_Array compositeObjectCTM, boolean hasCtm, org.ofdrw.core.basicType.ST_Array ctm, boolean fixOriginToPdf, double scale)