| Modifier and Type | Field and Description |
|---|---|
| protected static final int | |
| private static final Charset | |
| protected static final byte | ASCII_CR
ASCII code for carriage return. |
| protected static final byte | ASCII_LF
ASCII code for line feed. |
| private static final byte | |
| private static final byte | |
| private static final byte | |
| protected static final int | |
| protected static final int | |
| public static final String | DEF
This is a string constant that will be used for comparisons. |
| protected COSDocument | document
This is the document that will be parsed. |
| protected static final int | |
| protected static final String | ENDOBJ_STRING
This is a string constant that will be used for comparisons. |
| protected static final String | ENDSTREAM_STRING
This is a string constant that will be used for comparisons. |
| private static final char[] | FALSE
This is a string constant that will be used for comparisons. |
| private static final long | |
| protected static final int | |
| private final Map | |
| private static final Log | LOG
Log instance. |
| protected static final int | |
| pack-priv static final int | |
| protected static final int | |
| private static final char[] | NULL
This is a string constant that will be used for comparisons. |
| protected static final int | |
| private static final long | |
| protected static final int | |
| protected static final int | |
| protected final RandomAccessRead | source
This is the stream that will be read from. |
| protected static final String | STREAM_STRING
This is a string constant that will be used for comparisons. |
| protected static final int | |
| private static final char[] | TRUE
This is a string constant that will be used for comparisons. |
| private final CharsetDecoder |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private int | Returns: the corrected value of the brace counterthe number of braces currently open. bracesParameter)This is really a bug in the Document creators code, but it caused a crash in PDFBox, the first bug was in this format: /Title ( (5) /Creator which was patched in 1 place. |
| private String | Returns: the decoded Stringthe buffer)ByteArrayOutputStream containing the bytes to decodeTries to decode the buffer cotent to an UTF-8 String. |
| private COSBase | |
| protected COSObjectKey | Returns: the COS object keythe given object number num, int the given generation number gen)Returns the object key for the given combination of object and generation number. |
| protected boolean | Returns: true if the next byte is ']', false otherwise.This will tell if the next character is a closing brace( close of PDF array ). |
| protected boolean | Returns: true if the next byte is ']', false otherwise.The character to check against end of line c)This will tell if the next character is a closing brace( close of PDF array ). |
| private boolean | |
| protected boolean | Returns: true if the next byte in the stream is a digit.This will tell if the next byte is a digit or not. |
| protected static boolean | Returns: true if the next byte in the stream is a digit.The character to be checked c)This will tell if the given value is a digit or not. |
| protected boolean | Returns: true if the character terminates a PDF name, otherwise false.The character ch)Determine if a character terminates a PDF name. |
| protected boolean | Returns: true if the end of the data is reached.This will tell if the end of the data is reached. |
| protected boolean | Returns: true if the next byte is 0x0A or 0x0D.This will tell if the next byte to be read is an end of line byte. |
| protected boolean | Returns: true if the next byte is 0x0A or 0x0D.The character to check against end of line c)This will tell if the next byte to be read is an end of line byte. |
| private static boolean | |
| private boolean | |
| protected boolean | Returns: true if the next byte in the stream is a space character.This will tell if the next byte is a space or not. |
| protected boolean | Returns: true if the next byte in the stream is a space character.The character to check against space c)This will tell if the given value is a space or not. |
| protected boolean | Returns: true if the next byte in the stream is a whitespace character.This will tell if the next byte is whitespace or not. |
| protected static boolean | Returns: true if the character is a whitespace character.The character to check against whitespace c)This will tell if a character is whitespace or not. |
| protected COSArray | |
| protected COSDictionary | Returns: The parsed dictionary, never null.indicates whether the dictionary to be read is a direct object isDirect)This will parse a PDF dictionary. |
| private boolean | |
| private COSBase | Returns: The parsed Dictionary object.This will parse a PDF dictionary value. |
| private COSString | Returns: The parsed PDF string.This will parse a PDF HEX string with fail fast semantic meaning that we stop if a not allowed character is found. |
| protected COSName | |
| private COSNumber | |
| protected COSString | |
| protected COSBase | |
| protected void | readExpectedChar(char
the char value that is expected. ec)Read one char and throw an exception if it is not the expected value. |
| protected final void | readExpectedString(final char[]
pattern to be skipped expectedString, boolean if set to true spaces before and after the string will be skipped skipSpaces)Reads given pattern from |
| protected int | Returns: the generation number being read.This will read a integer from the Stream and throw an |
| protected int | Returns: The integer that was read from the stream.This will read an integer from the stream. |
| protected String | Returns: The characters between the current position and the end of the line.This will read bytes until the first end of line marker occurs. |
| protected long | |
| protected long | Returns: the object number being read.This will read a long from the Stream and throw an |
| protected String | Returns: The string that was read from the stream, never null.This will read the next string from the stream. |
| protected String | Returns: The string that was read from the stream of length 0 to length.The length to stop reading at. length)This will read the next string from the stream up to a certain length. |
| protected final StringBuilder | Returns: the token to parse as integer or long by the calling method.This method is used to read a token by the readInt() and the readLong() method. |
| private boolean | Returns: true if the end of the object or the file has been found, false if not, i.e. that the caller can continue to parse the dictionary at the current position.Keep reading until the end of the dictionary object or the file has been hit, or until a '/' has been found. |
| protected void | |
| protected void |
| A | back to summary |
|---|---|
| protected static final int A | |
| ALTERNATIVE_CHARSET | back to summary |
|---|---|
| private static final Charset ALTERNATIVE_CHARSET | |
| ASCII_CR | back to summary |
|---|---|
| protected static final byte ASCII_CR ASCII code for carriage return. | |
| ASCII_LF | back to summary |
|---|---|
| protected static final byte ASCII_LF ASCII code for line feed. | |
| ASCII_NINE | back to summary |
|---|---|
| private static final byte ASCII_NINE | |
| ASCII_SPACE | back to summary |
|---|---|
| private static final byte ASCII_SPACE | |
| ASCII_ZERO | back to summary |
|---|---|
| private static final byte ASCII_ZERO | |
| B | back to summary |
|---|---|
| protected static final int B | |
| D | back to summary |
|---|---|
| protected static final int D | |
| DEF | back to summary |
|---|---|
| public static final String DEF This is a string constant that will be used for comparisons. | |
| document | back to summary |
|---|---|
| protected COSDocument document This is the document that will be parsed. | |
| E | back to summary |
|---|---|
| protected static final int E | |
| ENDOBJ_STRING | back to summary |
|---|---|
| protected static final String ENDOBJ_STRING This is a string constant that will be used for comparisons. | |
| ENDSTREAM_STRING | back to summary |
|---|---|
| protected static final String ENDSTREAM_STRING This is a string constant that will be used for comparisons. | |
| FALSE | back to summary |
|---|---|
| private static final char[] FALSE This is a string constant that will be used for comparisons. | |
| GENERATION_NUMBER_THRESHOLD | back to summary |
|---|---|
| private static final long GENERATION_NUMBER_THRESHOLD | |
| J | back to summary |
|---|---|
| protected static final int J | |
| keyCache | back to summary |
|---|---|
| private final Map<Long, COSObjectKey> keyCache | |
| LOG | back to summary |
|---|---|
| private static final Log LOG Log instance. | |
| M | back to summary |
|---|---|
| protected static final int M | |
| MAX_LENGTH_LONG | back to summary |
|---|---|
| pack-priv static final int MAX_LENGTH_LONG | |
| N | back to summary |
|---|---|
| protected static final int N | |
| NULL | back to summary |
|---|---|
| private static final char[] NULL This is a string constant that will be used for comparisons. | |
| O | back to summary |
|---|---|
| protected static final int O | |
| OBJECT_NUMBER_THRESHOLD | back to summary |
|---|---|
| private static final long OBJECT_NUMBER_THRESHOLD | |
| R | back to summary |
|---|---|
| protected static final int R | |
| S | back to summary |
|---|---|
| protected static final int S | |
| source | back to summary |
|---|---|
| protected final RandomAccessRead source This is the stream that will be read from. | |
| STREAM_STRING | back to summary |
|---|---|
| protected static final String STREAM_STRING This is a string constant that will be used for comparisons. | |
| T | back to summary |
|---|---|
| protected static final int T | |
| TRUE | back to summary |
|---|---|
| private static final char[] TRUE This is a string constant that will be used for comparisons. | |
| utf8Decoder | back to summary |
|---|---|
| private final CharsetDecoder utf8Decoder | |
| BaseParser | back to summary |
|---|---|
| pack-priv BaseParser(RandomAccessRead pdfSource) Default constructor. | |
| checkForEndOfString | back to summary |
|---|---|
| private int checkForEndOfString(final int bracesParameter) throws IOException This is really a bug in the Document creators code, but it caused a crash in PDFBox, the first bug was in this format: /Title ( (5) /Creator which was patched in 1 place. However it missed the case where the number of opening and closing parenthesis isn't balanced The second bug was in this format /Title (c:\) /Producer
| |
| decodeBuffer | back to summary |
|---|---|
| private String decodeBuffer(ByteArrayOutputStream buffer) throws UnsupportedEncodingException Tries to decode the buffer cotent to an UTF-8 String. If that fails, tries the alternative Encoding.
| |
| getObjectFromPool | back to summary |
|---|---|
| private COSBase getObjectFromPool(COSObjectKey key) throws IOException | |
| getObjectKey | back to summary |
|---|---|
| protected COSObjectKey getObjectKey(long num, int gen) Returns the object key for the given combination of object and generation number. The object key from the cross reference table/stream will be reused if available. Otherwise a newly created object will be returned.
| |
| isClosing | back to summary |
|---|---|
| protected boolean isClosing() throws IOException This will tell if the next character is a closing brace( close of PDF array ).
| |
| isClosing | back to summary |
|---|---|
| protected boolean isClosing(int c) This will tell if the next character is a closing brace( close of PDF array ).
| |
| isCR | back to summary |
|---|---|
| private boolean isCR(int c) | |
| isDigit | back to summary |
|---|---|
| protected boolean isDigit() throws IOException This will tell if the next byte is a digit or not.
| |
| isDigit | back to summary |
|---|---|
| protected static boolean isDigit(int c) This will tell if the given value is a digit or not.
| |
| isEndOfName | back to summary |
|---|---|
| protected boolean isEndOfName(int ch) Determine if a character terminates a PDF name.
| |
| isEOF | back to summary |
|---|---|
| protected boolean isEOF() throws IOException This will tell if the end of the data is reached.
| |
| isEOL | back to summary |
|---|---|
| protected boolean isEOL() throws IOException This will tell if the next byte to be read is an end of line byte.
| |
| isEOL | back to summary |
|---|---|
| protected boolean isEOL(int c) This will tell if the next byte to be read is an end of line byte.
| |
| isHexDigit | back to summary |
|---|---|
| private static boolean isHexDigit(char ch) | |
| isLF | back to summary |
|---|---|
| private boolean isLF(int c) | |
| isSpace | back to summary |
|---|---|
| protected boolean isSpace() throws IOException This will tell if the next byte is a space or not.
| |
| isSpace | back to summary |
|---|---|
| protected boolean isSpace(int c) This will tell if the given value is a space or not.
| |
| isWhitespace | back to summary |
|---|---|
| protected boolean isWhitespace() throws IOException This will tell if the next byte is whitespace or not.
| |
| isWhitespace | back to summary |
|---|---|
| protected static boolean isWhitespace(int c) This will tell if a character is whitespace or not. These values are specified in table 1 (page 12) of ISO 32000-1:2008.
| |
| parseCOSArray | back to summary |
|---|---|
| protected COSArray parseCOSArray() throws IOException This will parse a PDF array object.
| |
| parseCOSDictionary | back to summary |
|---|---|
| protected COSDictionary parseCOSDictionary(boolean isDirect) throws IOException This will parse a PDF dictionary.
| |
| parseCOSDictionaryNameValuePair | back to summary |
|---|---|
| private boolean parseCOSDictionaryNameValuePair(COSDictionary obj) throws IOException | |
| parseCOSDictionaryValue | back to summary |
|---|---|
| private COSBase parseCOSDictionaryValue() throws IOException This will parse a PDF dictionary value.
| |
| parseCOSHexString | back to summary |
|---|---|
| private COSString parseCOSHexString() throws IOException This will parse a PDF HEX string with fail fast semantic meaning that we stop if a not allowed character is found. This is necessary in order to detect malformed input and be able to skip to next object start. We assume starting '<' was already read.
| |
| parseCOSName | back to summary |
|---|---|
| protected COSName parseCOSName() throws IOException This will parse a PDF name from the stream.
| |
| parseCOSNumber | back to summary |
|---|---|
| private COSNumber parseCOSNumber() throws IOException | |
| parseCOSString | back to summary |
|---|---|
| protected COSString parseCOSString() throws IOException This will parse a PDF string.
| |
| parseDirObject | back to summary |
|---|---|
| protected COSBase parseDirObject() throws IOException This will parse a directory object from the stream.
| |
| readExpectedChar | back to summary |
|---|---|
| protected void readExpectedChar(char ec) throws IOException Read one char and throw an exception if it is not the expected value.
| |
| readExpectedString | back to summary |
|---|---|
| protected final void readExpectedString(final char[] expectedString, boolean skipSpaces) throws IOException Reads given pattern from
| |
| readGenerationNumber | back to summary |
|---|---|
| protected int readGenerationNumber() throws IOException This will read a integer from the Stream and throw an
| |
| readInt | back to summary |
|---|---|
| protected int readInt() throws IOException This will read an integer from the stream.
| |
| readLine | back to summary |
|---|---|
| protected String readLine() throws IOException This will read bytes until the first end of line marker occurs. Note The EOL marker may consists of 1 (CR or LF) or 2 (CR and CL) bytes which is an important detail if one wants to unread the line.
| |
| readLong | back to summary |
|---|---|
| protected long readLong() throws IOException This will read an long from the stream.
| |
| readObjectNumber | back to summary |
|---|---|
| protected long readObjectNumber() throws IOException This will read a long from the Stream and throw an
| |
| readString | back to summary |
|---|---|
| protected String readString() throws IOException This will read the next string from the stream.
| |
| readString | back to summary |
|---|---|
| protected String readString(int length) throws IOException This will read the next string from the stream up to a certain length.
| |
| readStringNumber | back to summary |
|---|---|
| protected final StringBuilder readStringNumber() throws IOException This method is used to read a token by the readInt() and the readLong() method. Valid delimiters are any non digit values.
| |
| readUntilEndOfCOSDictionary | back to summary |
|---|---|
| private boolean readUntilEndOfCOSDictionary() throws IOException Keep reading until the end of the dictionary object or the file has been hit, or until a '/' has been found.
| |
| skipSpaces | back to summary |
|---|---|
| protected void skipSpaces() throws IOException This will skip all spaces and comments that are present.
| |
| skipWhiteSpaces | back to summary |
|---|---|
| protected void skipWhiteSpaces() throws IOException | |