Author Topic: PDF with invalid xref table  (Read 124 times)

RZTitus

  • Newbie
  • *
  • Posts: 3
PDF with invalid xref table
« on: March 11, 2019, 02:28:26 PM »
Hi,

I'm using exiftool to read/edit metadata. I have some files which give a warming - Invalid xref table.

Is there anyway to try and recover the file or fix the xref table?

Cheers

Rohit

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: PDF with invalid xref table
« Reply #1 on: March 11, 2019, 08:58:41 PM »
Hi Rohit,

Update to the current version of ExifTool (11.31) if you aren't already using it.

If you are getting this warning with the most recent version, send me a sample PDF giving this warning and I'll take a look.  (phil at owl.phy.queensu.ca)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: PDF with invalid xref table
« Reply #2 on: March 12, 2019, 07:54:33 AM »
Hi Rohit,

I got the samples, thanks.

Indeed, the XREF tables at the end of these files have been either truncated or scrambled.

The only thing I don't understand is why Adobe Reader opens these files without any problems.  I can save one file from Adobe Reader and the resulting PDF is OK.  I can't save the other one because apparently it is read-only (dumb PDF security features).

At any rate, ExifTool is correct in not writing these files because there is a significant problem with the file that could result in further data loss.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).