Class TransformCreator
java.lang.Object
com.openhtmltopdf.render.displaylist.TransformCreator
Static helper methods to create transforms, either in document coordinates or page coordinates.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
applyTransformFunctions
(float flipFactor, List<PropertyValue> transformList, AffineTransform result, Box box, CssContext ctx) private static float
static AffineTransform
createDocumentCoordinatesTransform
(Box master, CssContext c, AffineTransform _parentCtm) Creates an absolute transform in document coordinates.static AffineTransform
createPageCoordinatesTranform
(RenderingContext c, Box box, PageBox page, int shadowPageNumber) Creates a transform that can be applied to a page, either PDF or Java2D.static AffineTransform
createPageMarginCoordinatesTransform
(RenderingContext c, Box box, PageBox page, int xTranslate, int yTranslate) private static void
createTransform
(CssContext c, Box box, PageBox page, AffineTransform result, TransformCreator.TransformYOrigin transformYOrigin, int shadowPageNumber) page
may be null in the case thattransformYOrigin
isDOCUMENT_TOP
.private static float
getPageTranslateX
(float absTranslateX, int shadowPageNumber, PageBox page, CssContext c, Box box)
-
Constructor Details
-
TransformCreator
public TransformCreator()
-
-
Method Details
-
createPageCoordinatesTranform
public static AffineTransform createPageCoordinatesTranform(RenderingContext c, Box box, PageBox page, int shadowPageNumber) Creates a transform that can be applied to a page, either PDF or Java2D. This transform can be applied on top of other tranforms already in effect on the page. -
createPageMarginCoordinatesTransform
public static AffineTransform createPageMarginCoordinatesTransform(RenderingContext c, Box box, PageBox page, int xTranslate, int yTranslate) -
createDocumentCoordinatesTransform
public static AffineTransform createDocumentCoordinatesTransform(Box master, CssContext c, AffineTransform _parentCtm) Creates an absolute transform in document coordinates. This is typically used to figure out what pages the box will fall on. The_parentCtm
may be null in case the parent layer uses the identity tranform. If it is not null it will be cloned before use. -
getPageTranslateX
private static float getPageTranslateX(float absTranslateX, int shadowPageNumber, PageBox page, CssContext c, Box box) -
createTransform
private static void createTransform(CssContext c, Box box, PageBox page, AffineTransform result, TransformCreator.TransformYOrigin transformYOrigin, int shadowPageNumber) page
may be null in the case thattransformYOrigin
isDOCUMENT_TOP
. Otherwise, every argument is required. shadowPageNumber is -1 for the base page. -
applyTransformFunctions
private static void applyTransformFunctions(float flipFactor, List<PropertyValue> transformList, AffineTransform result, Box box, CssContext ctx) -
convertAngleToRadians
-