Class PointUtil
java.lang.Object
org.ofdrw.converter.utils.PointUtil
- Since:
- 2020/8/11
- Author:
- dltech21
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]adjustPos(double width, double height, double x, double y, org.ofdrw.core.basicType.ST_Box boundary) calPathPoint(List<PathPoint> abbreviatedPoint) static doublecalPdfPathLineWidth(double lineWidth, double scale, boolean legacyAbsolutePath, org.ofdrw.core.basicType.ST_Array ctm) Converts an OFD path line width to PDF points.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(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) 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) 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) 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) static List<TextCodePoint> calTextPoint(List<org.ofdrw.core.text.TextCode> textCodes) static org.ofdrw.core.basicType.ST_BoxcombineBoundary(org.ofdrw.core.basicType.ST_Box parentBoundary, org.ofdrw.core.basicType.ST_Box childBoundary) 将子图元的外接矩形转换到父图元坐标系。convertPathAbbreviatedDatatoPoint(String abbreviatedData) 解析压缩路径为点坐标static double[]ctmCalPoint(double x, double y, Double[] ctm) static booleanisLegacyAbsolutePath(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.
-
Constructor Details
-
PointUtil
public PointUtil()
-
-
Method Details
-
convertPathAbbreviatedDatatoPoint
-
calPathPoint
-
calTextPoint
-
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
-
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)
-