On Thu, Mar 30, 2023 at 1:54 PM luigi scarso <luigi.sca...@gmail.com> wrote:
> > > On Tue, 14 Mar 2023 at 20:35, Andreas Matthias <andreas.matth...@gmail.com> > wrote: > >> The manual says that >> >> str, n = pdfe.readfromstream(<stream>) >> >> reads the stream in chunks. Now I had expected that `str` is just one >> chunk of the whole stream. >> But it seems that `str` always contains the whole stream. >> >> Could someone enlighten me what "read in chunks" means? >> >> > I need a short example . > Run texlua with this code: local doc = pdfe.open('test.pdf') local page = pdfe.getpage(doc, 1) local stream = page['Contents'] pdfe.openstream(stream) local str, n = pdfe.readfromstream(stream) print(str) print(n) Here test.pdf is: \pdfvariable compresslevel = 0 \pdfvariable objcompresslevel = 0 Lorem ipsum dolor sit amet ... a lot more text here ... \bye Not matter how long the stream is, pdfe.readfromstream() always returns the whole stream. What's the difference to pdfe.readwholestream()? Cheers Andreas