Adding %% EOF to PDF file in python

I am trying to open a PDF file with pyPdf. I am getting the following error:

pyPdf.utils.PdfReadError: EOF marker not found

      

I thought I should add EOF myself. However, I don't want to write bytes. Isn't it an OS? I want to call something like os.eof (). What am I writing? This thread doesn't help.

+3


source to share


1 answer


The EOF PDF marker is a special string ( %%EOF

) that should appear in your PDF file. If not, you have the wrong format . This line separates the actual PDF content from any additional data (embedded files, etc.).



It has nothing to do with the event EOF

you fire when you read any file to its end.

+4


source







All Articles