Zend_Pdf_FileParserAbstract utility class for parsing binary files.
Provides a library of methods to quickly navigate and extract various data types (signed and unsigned integers, floating- and fixed-point numbers, strings, etc.) from the file.
File access is managed via a Zend_Pdf_FileParserDataSource object. This allows the same parser code to work with many different data sources: in-memory objects, filesystem files, etc.
Located in /Zend/Pdf/FileParser.php (line 41)
| Class | Description |
|---|---|
Zend_Pdf_FileParser_Font
|
Abstract helper class for Zend_Pdf_Font that parses font files. |
float
readFixed
(integer $mantissaBits, integer $fractionBits, [integer $byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN])
string
readStringUTF16
(integer $byteCount, [integer $byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN], [string $characterSet = ''])
Zend_Pdf_FileParserDataSource
$_dataSource
= null (line 76)
Object representing the data source to be parsed.
boolean
$_isParsed
= false (line 70)
Flag indicating that the file has been sucessfully parsed.
boolean
$_isScreened
= false (line 64)
Flag indicating that the file has passed a cursory validation check.
Constructor __construct (line 115)
Object constructor.
Verifies that the data source has been properly initialized.
Destructor __destruct (line 129)
Object destructor.
Discards the data source object.
getDataSource (line 162)
Returns the data source object representing the file being parsed.
isBitSet (line 328)
Returns true if the specified bit is set in the integer bitfield.
isParsed (line 152)
Returns true if the file has been successfully parsed.
isScreened (line 142)
Returns true if the file has passed a cursory validation check.
moveToOffset (line 176)
Convenience wrapper for the data source object's moveToOffset() method.
parse (line 102)
Reads and parses the complete binary file.
Must set $this->_isParsed to true if successful.
readBytes (line 188)
Convenience wrapper for the data source object's readBytes() method.
readFixed (line 352)
Reads the signed fixed-point number from the binary file at the current byte offset.
Common fixed-point sizes are 2.14 and 16.16.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
readInt (line 221)
Reads the signed integer value from the binary file at the current byte offset.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
readStringMacRoman (line 429)
Reads the Mac Roman-encoded string from the binary file at the current byte offset.
You must supply the desired resulting character set.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
readStringPascal (line 459)
Reads the Pascal string from the binary file at the current byte offset.
The length of the Pascal string is determined by reading the length bytes which preceed the character data. You must supply the desired resulting character set.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
readStringUTF16 (line 389)
Reads the Unicode UTF-16-encoded string from the binary file at the current byte offset.
The byte order of the UTF-16 string must be specified. You must also supply the desired resulting character set.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
readUInt (line 294)
Reads the unsigned integer value from the binary file at the current byte offset.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
NOTE: If you ask for a 4-byte unsigned integer on a 32-bit machine, the resulting value WILL BE SIGNED because PHP uses signed integers internally for everything. To guarantee portability, be sure to use bitwise operators operators on large unsigned integers!
screen (line 93)
Performs a cursory check to verify that the binary file is in the expected format. Intended to quickly weed out obviously bogus files.
Must set $this->_isScreened to true if successful.
skipBytes (line 199)
Convenience wrapper for the data source object's skipBytes() method.
Documentation generated on Wed, 21 Feb 2007 11:47:58 -0800 by phpDocumentor 1.3.1