All: I am using PDF files generated from matplotlib, and a PDF parser from ReportLab, Inc. Their tool encountered a bug in the PDF specification. The company’s email to me follows:
…matplotlib is violating the PDF specification. There
is a structure near the end of the file shown below, and they have put
an ‘n’ instead of an ‘f’ which tells a (suitably pedantic) parser that
the first meaningful content is to be found at byte 0 in the file, not
byte 16 where it really lives.
0000000000 65535 n <---- should be ‘f’
0000000016 00000 n
0000000065 00000 n
0000000218 00000 n
That row with the ‘00000000 65535’ is present in all PDF files. I
change the ‘n’ to an ‘f’ in a good binary editor and it goes through
I have also added a special case to our code to correct for this. I
suspect other PDF viewers just skip the first row so were not bitten.
I was able to figure out which module contains the offending code, but not which lines actually print out that data.
I submitted a bug report here: