<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 30, 2023 at 1:54 PM luigi scarso <<a href="mailto:luigi.scarso@gmail.com">luigi.scarso@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Mar 2023 at 20:35, Andreas Matthias <<a href="mailto:andreas.matthias@gmail.com" target="_blank">andreas.matthias@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:small">The manual says that <br></div><div style="font-family:arial,sans-serif;font-size:small"><br></div><div style="font-family:arial,sans-serif;font-size:small">   str, n = pdfe.readfromstream(<stream>)</div><div style="font-family:arial,sans-serif;font-size:small"><br></div><div style="font-family:arial,sans-serif;font-size:small">reads the stream in chunks. Now I had expected that `str` is just one chunk of the whole stream.</div><div style="font-family:arial,sans-serif;font-size:small">But it seems that `str` always contains the whole stream.</div><div style="font-family:arial,sans-serif;font-size:small"><br></div><div style="font-family:arial,sans-serif;font-size:small">Could someone enlighten me what "read in chunks" means?</div><div style="font-family:arial,sans-serif;font-size:small"><br></div></div></blockquote><div><br></div><div>I need a short example .</div></div></div></blockquote><div><br></div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">Run texlua with this code:<br></div><br></div><div><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">  </span><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small"> </span>local doc = pdfe.open('test.pdf')<br><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">   </span>local page = pdfe.getpage(doc, 1)<br><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">   </span>local stream = page['Contents']<br><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">   </span>pdfe.openstream(stream)<br><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">   </span>local str, n = pdfe.readfromstream(stream)<br><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">   </span>print(str)<br><span class="gmail_default" style="font-family:arial,sans-serif;font-size:small">   </span>print(n)</div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">Here test.pdf is:</div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default"><br></div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">   \pdfvariable compresslevel = 0<br>   \pdfvariable objcompresslevel = 0<br>   Lorem ipsum dolor sit amet</div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">   ... a lot more text here ...<br></div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">   \bye<br></div></div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">Not matter how long the stream is, pdfe.readfromstream() always returns the whole stream.</div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">What's the difference to pdfe.readwholestream()?</div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default"><br></div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">Cheers</div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default">Andreas</div><div style="font-family:arial,sans-serif;font-size:small" class="gmail_default"></div><br></div></div></div>