> Hmm. AFAIK the implementation should not emit more characters in that > case. If it does that then it is a bug. > > For me it makes sense to call flush into pdf_stm_destroy: it is > what you get when you call fclose, for example. >
Yep, you are right. My problem was with calling a finish, not a flush. > Hmm. Consider that you want to ahex encode 20mb of data. You want to > do it in chunks of 4k, so you call pdf_stm_write (my_buf, 4k). The > internal filter chain will consume any output from 'my_buf' until it > generates an EOF condition, but we certainly dont want to finish the > filters at that point... > I didn't mean that EOF. I think that we can do it like this: - On write mode: Call pdf_stm_finish on pdf_stm_destroy. - On read mode: Call pdf_stm_finish on backend EOF. If behaving that way I think that we can make the finishing process transparent and correct. What do you think? JP
