Question: a pdf file must end with an eof line?
Answer: The last line of the PDF document contains the end of file string '%%EOF'. Before the end of file tag, there is a line with a string startxref that specifies the offset from beginning of the file to the cross reference table.