public final class CTMHelper
extends java.lang.Object
CTM
Constructor and Description |
---|
CTMHelper() |
Modifier and Type | Method and Description |
---|---|
static double[] |
toPDFArray(CTM sourceMatrix)
Creates an array of six doubles from the source CTM.
|
static CTM |
toPDFCTM(CTM sourceMatrix)
Creates a new CTM based in the sourceMatrix.
|
static java.lang.String |
toPDFString(java.awt.geom.AffineTransform transform,
boolean convertMillipoints)
Converts the AffineTransform instance to a string for use in the PDFRenderer
cm operations.
|
static java.lang.String |
toPDFString(CTM sourceMatrix)
Converts the sourceMatrix to a string for use in the PDFRenderer cm operations.
|
public static java.lang.String toPDFString(CTM sourceMatrix)
Converts the sourceMatrix to a string for use in the PDFRenderer cm operations.
For example:
org.apache.fop.area.CTM ctm = new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0); String pdfMatrix = org.apache.fop.render.pdf.CTMHelper.toPDFString(ctm);will return the string "
1.0 0.0 0.0 1.0 1.0 1.0
".sourceMatrix
- - The matrix to convert.public static java.lang.String toPDFString(java.awt.geom.AffineTransform transform, boolean convertMillipoints)
Converts the AffineTransform instance to a string for use in the PDFRenderer cm operations.
transform
- The matrix to convert.convertMillipoints
- Indicates that the matrix needs to be converted from millipoints
to points.public static CTM toPDFCTM(CTM sourceMatrix)
Creates a new CTM based in the sourceMatrix.
For example:
org.apache.fop.area.CTM inCTM = new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0); org.apache.fop.area.CTM outCTM = org.apache.fop.render.pdf.CTMHelper.toPDFCTM(ctm);will return a new CTM where a == 1.0, b == 0.0, c == 0.0, d == 1.0, e == 1.0 and f == 1.0.
sourceMatrix
- - The matrix to convert.public static double[] toPDFArray(CTM sourceMatrix)
Creates an array of six doubles from the source CTM.
For example:
org.apache.fop.area.CTM inCTM = new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0); double matrix[] = org.apache.fop.render.pdf.CTMHelper.toPDFArray(ctm);will return a new array where matrix[0] == 1.0, matrix[1] == 0.0, matrix[2] == 0.0, matrix[3] == 1.0, matrix[4] == 1.0 and matrix[5] == 1.0.
sourceMatrix
- - The matrix to convert.Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.