On Mon, Jun 15, 2009 at 22:29:32 +0200, [email protected] wrote: > > A possible solution for this problem could be to change/expand the stm > public api in the following way: > > - Rename the current pdf_stm_seek/tell functions to > pdf_stm_bseek/btell. The 'b' is for 'backend'. > > - Add a new function pdf_stm_tell that returns the number of octects > since the last bseek (or since the creation of the stream if no > bseek was made). > > Since the operation in the streams is inherently sequential, that > schema makes sense in my opinion.
I agree. > The addition of a new function to the tokeniser returning the offset > of the beginning of the last read token would then use this > pdf_stm_tell function. > > What do you think? If you agree I will implement it as part of my > type4+tokeniser patch. It looks good to me. The easiest way to implement it in the token reader would probably be to replace the "reader->state = X" statements with calls to a private function (e.g. enter_state) that would also store the token's starting position. Then in flush_token, store this value when emitting a token. -- Michael
signature.asc
Description: Digital signature
