Class PDFUtils


  • public class PDFUtils
    extends java.lang.Object
    Various utility functions for working with the PDF format.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PDFUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] toBytes​(java.lang.String s)
      A utility method to convert a string to US-ASCII byte format.
      static java.lang.String toDateFormat​(java.util.Date date)
      Returns a string in standard PDF date format representing the specified date (in the default timezone).
      static java.lang.String toPDFArray​(boolean[] b)
      A utility method to convert a boolean[] to a PDF array string.
      static java.lang.String toPDFArray​(double[] d)
      A utility method to convert a double[] to a PDF array string.
      static java.lang.String toPDFArray​(float[] f)
      A utility method to convert a float[] to a PDF array string.
      static java.lang.String toPDFDateFormat​(java.util.Calendar calendar)
      Returns a string in standard PDF date format representing the date contained by the specified calendar.
      static java.lang.String transformToPDF​(java.awt.geom.AffineTransform t)
      Returns a Java2D AffineTransform in PDF matrix format.
      • Methods inherited from class java.lang.Object

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

      • PDFUtils

        private PDFUtils()
    • Method Detail

      • toPDFArray

        public static java.lang.String toPDFArray​(boolean[] b)
        A utility method to convert a boolean[] to a PDF array string.
        Parameters:
        b - the array (null not permitted).
        Returns:
        The string.
      • toPDFArray

        public static java.lang.String toPDFArray​(float[] f)
        A utility method to convert a float[] to a PDF array string.
        Parameters:
        f - the array (null not permitted).
        Returns:
        The string.
      • toPDFArray

        public static java.lang.String toPDFArray​(double[] d)
        A utility method to convert a double[] to a PDF array string.
        Parameters:
        d - the array (null not permitted).
        Returns:
        The string.
      • transformToPDF

        public static java.lang.String transformToPDF​(java.awt.geom.AffineTransform t)
        Returns a Java2D AffineTransform in PDF matrix format.
        Parameters:
        t - the transform (null not permitted).
        Returns:
        A PDF matrix string.
      • toDateFormat

        public static java.lang.String toDateFormat​(java.util.Date date)
        Returns a string in standard PDF date format representing the specified date (in the default timezone).
        Parameters:
        date - the date (null not permitted).
        Returns:
        A string in standard PDF date format.
      • toPDFDateFormat

        public static java.lang.String toPDFDateFormat​(java.util.Calendar calendar)
        Returns a string in standard PDF date format representing the date contained by the specified calendar.
        Parameters:
        calendar - the date and timezone (null not permitted).
        Returns:
        A string in standard PDF date format.
      • toBytes

        public static byte[] toBytes​(java.lang.String s)
        A utility method to convert a string to US-ASCII byte format.
        Parameters:
        s - the string.
        Returns:
        The corresponding byte array.