Question: Perhaps we have an array of arrays such as this:

```
["a", "11.36"]
["b", "12.13"]
["c", "11.00"]

```

Is there a simple function to be able to sort them based on the 2nd index?

Answer: 
The end of file marker '%%EOF' is meant to be the very last line. It is a kind of marker where the pdf parser knows, that the PDF document ends here.

My solution is to force this marker to stay at the end:

```
def reset_eof(self, pdf_file):
    with open(pdf_file, 'rb') as p:
        txt = (p.readlines())
    for i, x in enumerate(txt[::-1]):
        if b'%%EOF' in x:
            actual_line = len(txt)-i-1
            break
    txtx = txt[:actual_line] + [b'%%EOF']
    with open(pdf_file, 'wb') as f:
        f.writelines(txtx)
    return PyPDF4.PdfFileReader(pdf_file)

```
I read that EOF is a kind of tag included in PDF files. [link in portuguese](https://living-sun.com/pt/python/724834-eof-marker-not-found-while-use-pypdf2-merge-pdf-file-in-python-python-pdf-pypdf2.html)

However, I guess some kinds of PDF files do not have the 'EOF marker' and PyPDF2 do not recognizes those ones.

So, what I did to fix "PdfReadError: EOF marker not found" was opening my PDF with Google Chromer and print it as .pdf once more, so that the file is converted to .pdf by Chromer and hopefully with the EOF marker.

I ran my script with the new .pdf file converted by Chromer and it worked fine.