title: appending %%EOF to a PDF file in python
body: <p>I'm trying to open a PDF with pyPdf. I get the following error:</p>
  
  <pre><code>pyPdf.utils.PdfReadError: EOF marker not found
  </code></pre>
  
  <p>I thought that I should add the EOF myself. However, I don't want to write bytes. Isn't it OS specific? I want to call something like os.eof(). What do I write? <a href="https://stackoverflow.com/questions/2371645/how-to-append-eof-to-file-using-perl-or-python">This</a> thread is not helpful.</p>