Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 2.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.render.pdf
Class CTMHelper

    java.lang.Object
      org.apache.fop.render.pdf.CTMHelper

    public final class CTMHelper

extends java.lang.Object

CTMHelper converts FOP transformation matrices to those suitable for use by the PDFRenderer. The e and f elements of the matrix will be divided by 1000 as FOP uses millipoints as it's default user space and PDF uses points.

See Also:
  `CTM`

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### toPDFString

    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`".

  Parameters:
    `sourceMatrix` - - The matrix to convert.
  Returns:
    a space seperated string containing the matrix elements.

### toPDFString

    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.

  Parameters:
    `transform` - The matrix to convert.
    `convertMillipoints` - Indicates that the matrix needs to be converted from millipoints to points.
  Returns:
    a space seperated string containing the matrix elements.

### toPDFCTM

    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.

  Parameters:
    `sourceMatrix` - - The matrix to convert.
  Returns:
    a new converted matrix.

### toPDFArray

    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.

  Parameters:
    `sourceMatrix` - - The matrix to convert.
  Returns:
    an array of doubles containing the converted matrix.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 2.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.