Package com.orsonpdf
Class PDFUtils
java.lang.Object
com.orsonpdf.PDFUtils
Various utility functions for working with the PDF format.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
A utility method to convert a string to US-ASCII byte format.static String
toDateFormat
(Date date) Returns a string in standard PDF date format representing the specified date (in the default timezone).static String
toPDFArray
(boolean[] b) A utility method to convert a boolean[] to a PDF array string.static String
toPDFArray
(double[] d) A utility method to convert a double[] to a PDF array string.static String
toPDFArray
(float[] f) A utility method to convert a float[] to a PDF array string.static String
toPDFDateFormat
(Calendar calendar) Returns a string in standard PDF date format representing the date contained by the specified calendar.static String
Returns a Java2D AffineTransform in PDF matrix format.
-
Constructor Details
-
PDFUtils
private PDFUtils()
-
-
Method Details
-
toPDFArray
A utility method to convert a boolean[] to a PDF array string.- Parameters:
b
- the array (null
not permitted).- Returns:
- The string.
-
toPDFArray
A utility method to convert a float[] to a PDF array string.- Parameters:
f
- the array (null
not permitted).- Returns:
- The string.
-
toPDFArray
A utility method to convert a double[] to a PDF array string.- Parameters:
d
- the array (null
not permitted).- Returns:
- The string.
-
transformToPDF
Returns a Java2D AffineTransform in PDF matrix format.- Parameters:
t
- the transform (null
not permitted).- Returns:
- A PDF matrix string.
-
toDateFormat
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
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
A utility method to convert a string to US-ASCII byte format.- Parameters:
s
- the string.- Returns:
- The corresponding byte array.
-