Class | PDF::Reader::Buffer |
In: |
lib/pdf/reader/buffer.rb
|
Parent: | Object |
A string tokeniser that recognises PDF grammar. When passed an IO stream or a string, repeated calls to token() will return the next token from the source.
This is very low level, and getting the raw tokens is not very useful in itself.
This will usually be used in conjunction with PDF:Reader::Parser, which converts the raw tokens into objects we can work with (strings, ints, arrays, etc)
TOKEN_WHITESPACE | = | ["\x00", "\x09", "\x0A", "\x0C", "\x0D", "\x20"] |
pos | [R] |
Creates a new buffer.
Params:
io - an IO stream or string with the raw data to tokenise
options:
:seek - a byte offset to seek to before starting to tokenise :content_stream - set to true if buffer will be tokenising a content stream. Defaults to false
return the byte offset where the first XRef table in th source can be found.