multivalent.std.adaptor.pdf

Class COS

public final class COS extends Object

Translations between Java and PDF "COS" (Carousel Object System) data types.

Version: $Revision: 1.6 $ $Date: 2003/08/29 03:48:33 $

Field Summary
static ClassCLASS_ARRAY
Java type (Object[]) of PDF array data type (e.g., [ 41 63 572 729 ]).
static ClassCLASS_BOOLEAN
Java type (Boolean) of PDF boolean data type (true or false).
static ClassCLASS_DATA
Java type (byte[]) for raw data, which is not a PDF data type, but which is sometimes mixed with them.
static ClassCLASS_DICTIONARY
Java type (Dict) of PDF dictionary data type (e.g., << /Length 705 /Filter /FlateDecode >>).
static ClassCLASS_INTEGER
Java type (Integer) of PDF integer number data type (e.g., 93515).
static ClassCLASS_IREF
Java type (IRef) of PDF indirect reference data type (e.g., 15 0 R).
static ClassCLASS_NAME
Java type (String) of PDF name data type (e.g., /Title).
static ClassCLASS_OBJSTMC
If move object into a ObjStm, replace it with the object number of the ObjStm of this class (java.lang.Long) .
static ClassCLASS_REAL
Java type (Double) of PDF real number data type (e.g., 0.9505).
static ClassCLASS_STRING
Java type (StringBuffer) of PDF string data type (e.g., (PDF Reference) and <a47cc386aea60669950095583bec355d>).
static StringEOF
String at end of trailer: "%%EOF".
static FileFilterFILTER
static intGEN_MAX
static StringKEY_COMPRESS
Key in trailer for direct dictionary with compression information.
static StringKEY_COMPRESS_COMPACT
Key in compression dictionary with indirect reference to Compact stream.
static StringKEY_COMPRESS_FILTER
Key in compression dictionary that gives compression method.
static StringKEY_COMPRESS_LENGTHO
Key in compression dictionary that gives original length of PDF.
static StringKEY_COMPRESS_ROOT
Key in compression dictionary that points to original /Catalog.
static StringKEY_COMPRESS_SPECO
Key in compression dictionary with major.
static StringKEY_COMPRESS_VERSION
Key in compresion dictionary that gives specification version of compression filter.
static ObjectOBJECT_DELETED
static ObjectOBJECT_NULL
static StringREALIZED
Injected key for objects cached within dictionaries, such as fonts, images.
static StringSIGNATURE
String at start of file that identifies as PDF: "%PDF-m.n".
static StringSTREAM_DATA
For stream dictionary, offset of data in file if of type Long, or data itself if of type byte[].
static byteXREF_FREE
Cross reference type 0.
static byteXREF_NORMAL
Cross reference type 1.
static byteXREF_OBJSTMC
Cross reference type 2 (component of /Type /ObjStm).
Method Summary
static Rectanglearray2Rectangle(Object[] oa, AffineTransform at, boolean fabs)
Converts PDF rectangle array ([llx lly urx ury]) to Java Rectangle (x,y, width, height), normalized to have positive width and height.
static StringBuffercreateDate(long javatimemillis)
Convert a Java time onto a PDF date.
static StringBuffercreateID(File file, Dict info)
Computes value for trailer /ID, for initializing both if /ID doesn't exist or for updating the second value.
static longparseDate(StringBuffer sb, boolean local)
Returns Java time of PDF Date.

Field Detail

CLASS_ARRAY

public static final Class CLASS_ARRAY
Java type (Object[]) of PDF array data type (e.g., [ 41 63 572 729 ]). Arrays can be heterogeneous. When creating new PDF array objects, always make a Object[] even though the array may be homogeneous of another type.

CLASS_BOOLEAN

public static final Class CLASS_BOOLEAN
Java type (Boolean) of PDF boolean data type (true or false).

CLASS_DATA

public static final Class CLASS_DATA
Java type (byte[]) for raw data, which is not a PDF data type, but which is sometimes mixed with them. Some applications cache the contents of a stream in the stream dictionary under the key STREAM_DATA, and if so remove the Length key in favor of taking this information from byte[].length. InputStreamComposite accepts such streams, and internally inline images are processed into such streams to make them identical to image XObjects for subsequent merged transformation.

CLASS_DICTIONARY

public static final Class CLASS_DICTIONARY
Java type (Dict) of PDF dictionary data type (e.g., << /Length 705 /Filter /FlateDecode >>). Dictionary keys are of type CLASS_NAME.

CLASS_INTEGER

public static final Class CLASS_INTEGER
Java type (Integer) of PDF integer number data type (e.g., 93515). Note PDF considers both integer and floating point the same type. When is possible to represent a number without lose of accuracy as an integer, this is preferred; this is what COS does.

CLASS_IREF

public static final Class CLASS_IREF
Java type (IRef) of PDF indirect reference data type (e.g., 15 0 R).

CLASS_NAME

public static final Class CLASS_NAME
Java type (String) of PDF name data type (e.g., /Title).

CLASS_OBJSTMC

public static final Class CLASS_OBJSTMC
If move object into a ObjStm, replace it with the object number of the ObjStm of this class (java.lang.Long) .

CLASS_REAL

public static final Class CLASS_REAL
Java type (Double) of PDF real number data type (e.g., 0.9505).

CLASS_STRING

public static final Class CLASS_STRING
Java type (StringBuffer) of PDF string data type (e.g., (PDF Reference) and <a47cc386aea60669950095583bec355d>). Note that PDF strings are not Java java.lang.Strings.

EOF

public static final String EOF
String at end of trailer: "%%EOF".

FILTER

public static final FileFilter FILTER

GEN_MAX

public static final int GEN_MAX

KEY_COMPRESS

public static final String KEY_COMPRESS
Key in trailer for direct dictionary with compression information. Within dictionary, COS, COS, KEY_COMPRESS_VERSION, KEY_COMPRESS_COMPACT.

KEY_COMPRESS_COMPACT

public static final String KEY_COMPRESS_COMPACT
Key in compression dictionary with indirect reference to Compact stream.

KEY_COMPRESS_FILTER

public static final String KEY_COMPRESS_FILTER
Key in compression dictionary that gives compression method.

KEY_COMPRESS_LENGTHO

public static final String KEY_COMPRESS_LENGTHO
Key in compression dictionary that gives original length of PDF.

KEY_COMPRESS_ROOT

public static final String KEY_COMPRESS_ROOT
Key in compression dictionary that points to original /Catalog.

KEY_COMPRESS_SPECO

public static final String KEY_COMPRESS_SPECO
Key in compression dictionary with major.minor of PDF specification compatibility modulo compression (Compact, ObjStm, ...).

KEY_COMPRESS_VERSION

public static final String KEY_COMPRESS_VERSION
Key in compresion dictionary that gives specification version of compression filter. Optional. Default: 1.0.

OBJECT_DELETED

public static final Object OBJECT_DELETED

OBJECT_NULL

public static final Object OBJECT_NULL

REALIZED

public static final String REALIZED
Injected key for objects cached within dictionaries, such as fonts, images.

SIGNATURE

public static final String SIGNATURE
String at start of file that identifies as PDF: "%PDF-m.n".

STREAM_DATA

public static final String STREAM_DATA
For stream dictionary, offset of data in file if of type Long, or data itself if of type byte[].

XREF_FREE

public static final byte XREF_FREE
Cross reference type 0.

XREF_NORMAL

public static final byte XREF_NORMAL
Cross reference type 1.

XREF_OBJSTMC

public static final byte XREF_OBJSTMC
Cross reference type 2 (component of /Type /ObjStm).

Method Detail

array2Rectangle

public static Rectangle array2Rectangle(Object[] oa, AffineTransform at, boolean fabs)
Converts PDF rectangle array ([llx lly urx ury]) to Java Rectangle (x,y, width, height), normalized to have positive width and height. Java rectangle in PDF coordinate space as described in passed AffineTransform.

createDate

public static StringBuffer createDate(long javatimemillis)
Convert a Java time onto a PDF date.

See Also: COS

createID

public static StringBuffer createID(File file, Dict info)
Computes value for trailer /ID, for initializing both if /ID doesn't exist or for updating the second value. Done on reads rather than writes so that guaranteed valid for subsequent operations. Returned StringBuffer 16 characters (8-bit bytes) long.

parseDate

public static long parseDate(StringBuffer sb, boolean local)
Returns Java time of PDF Date. PDF dates have the form (D:20010406143021).

Parameters: local convert time to local time

See Also: COS