Package com.orsonpdf

Class PDFUtils

java.lang.Object
com.orsonpdf.PDFUtils

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

    • PDFUtils

      private PDFUtils()
  • Method Details

    • toPDFArray

      public static 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 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 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 String transformToPDF(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 String toDateFormat(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 String toPDFDateFormat(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(String s)
      A utility method to convert a string to US-ASCII byte format.
      Parameters:
      s - the string.
      Returns:
      The corresponding byte array.