iText 8.0.2 API
|
Public Types |
|
enum | TokenType { Number, String, Name, Comment, StartArray, EndArray, StartDic, EndDic, Ref, Obj, EndObj, Other, EndOfFile } |
Public Member Functions |
|
PdfTokenizer (RandomAccessFileOrArray file) | |
Creates a PdfTokenizer for the specified RandomAccessFileOrArray. More... |
|
virtual void | Seek (long pos) |
virtual void | ReadFully (byte[] bytes) |
virtual long | GetPosition () |
virtual void | Close () |
virtual long | Length () |
virtual int | Read () |
virtual String | ReadString (int size) |
virtual PdfTokenizer.TokenType | GetTokenType () |
virtual byte[] | GetByteContent () |
virtual String | GetStringValue () |
virtual byte[] | GetDecodedStringContent () |
virtual bool | TokenValueEqualsTo (byte[] cmp) |
virtual int | GetObjNr () |
virtual int | GetGenNr () |
virtual void | BackOnePosition (int ch) |
virtual int | GetHeaderOffset () |
virtual String | CheckPdfHeader () |
virtual void | CheckFdfHeader () |
virtual long | GetStartxref () |
virtual void | NextValidToken () |
virtual bool | NextToken () |
virtual long | GetLongValue () |
virtual int | GetIntValue () |
virtual bool | IsHexString () |
virtual bool | IsCloseStream () |
virtual void | SetCloseStream (bool closeStream) |
virtual RandomAccessFileOrArray | GetSafeFile () |
virtual void | ThrowError (String error, params Object[] messageParams) |
Helper method to handle content errors. More... |
|
virtual bool | ReadLineSegment (ByteBuffer buffer) |
Reads data into the provided byte[]. More... |
|
virtual bool | ReadLineSegment (ByteBuffer buffer, bool isNullWhitespace) |
Reads data into the provided byte[]. More... |
|
Static Public Member Functions |
|
static byte[] | DecodeStringContent (byte[] content, bool hexWriting) |
Resolve escape symbols or hexadecimal symbols. More... |
|
static bool | IsWhitespace (int ch) |
Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'. More... |
|
static bool | CheckTrailer (ByteBuffer line) |
Checks whether line equals to 'trailer'. More... |
|
static int[] | CheckObjectStart (PdfTokenizer lineTokenizer) |
Check whether line starts with object declaration. More... |
|
|
inline |
Creates a PdfTokenizer for the specified RandomAccessFileOrArray.
Creates a PdfTokenizer for the specified RandomAccessFileOrArray. The beginning of the file is read to determine the location of the header, and the data source is adjusted as necessary to account for any junk that occurs in the byte source before the header
file | the source |
|
inlinestatic |
Check whether line starts with object declaration.
lineTokenizer | tokenizer, built by single line. |
|
inlinestatic |
Checks whether line equals to 'trailer'.
line | for check |
|
inlinestatic |
Resolve escape symbols or hexadecimal symbols.
Resolve escape symbols or hexadecimal symbols.
NOTE Due to PdfReference 1.7 part 3.2.3 String value contain ASCII characters, so we can convert it directly to byte array.
content | string bytes to be decoded |
hexWriting | true if given string is hex-encoded, e.g. '<69546578…>'. False otherwise, e.g. '((iText( some version)…)' |
|
inlinestatic |
Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'.
Is a certain character a whitespace? Currently checks on the following: '0', '9', '10', '12', '13', '32'.
The same as calling isWhiteSpace(ch, true).
ch | int |
|
inlinevirtual |
Reads data into the provided byte[].
Reads data into the provided byte[]. Checks on leading whitespace. See isWhiteSpace(int) or isWhiteSpace(int, boolean) for a list of whitespace characters.
The same as calling readLineSegment(input, true).
buffer | a ByteBuffer to which the result of reading will be saved |
|
inlinevirtual |
Reads data into the provided byte[].
Reads data into the provided byte[]. Checks on leading whitespace. See isWhiteSpace(int) or isWhiteSpace(int, boolean) for a list of whitespace characters.
buffer | a ByteBuffer to which the result of reading will be saved |
isNullWhitespace | boolean to indicate whether '0' is whitespace or not. If in doubt, use true or overloaded method readLineSegment(input) |
|
inlinevirtual |
Helper method to handle content errors.
Helper method to handle content errors. Add file position to PdfRuntimeException
.
error | message. |
messageParams | error params. |
|
static |