can't open pdf. error: File type unknown (application/octet-stream) is not supported

21,264

MIME type for a PDF on Ubuntu is application/pdf

but application/octet-stream (meaning any generic binary file) is a sort of catch all for files, and usually requires a file extension to determine what to open it with.

Download the PDF locally and save it as a PDF, making sure there is .pdf at the end.

Share:
21,264
Derrick Mar
Author by

Derrick Mar

About whom? me? Weblog | Github | Twitter | Facebook Questions are sometimes quite questionable.

Updated on September 18, 2022

Comments

  • Derrick Mar
    Derrick Mar almost 2 years

    I am struggling to open an important pdf file I have on my ubuntu 12.04, which is probably created on MS Windows(assuming since it has some formatting issue). When I open the file using a PDF viewer it shows me this error: File type unknown (application/octet-stream) is not supported

    I tried to open it using terminal, too. Here is the output:

    ➜  pdf: gnome-open mypdf.pdf
    Error: May not be a PDF file (continuing anyway)
    Error (30): Illegal character '{'
    Error: PDF file is damaged - attempting to reconstruct xref table...
    Error: Couldn't find trailer dictionary
    Error: Couldn't read xref table
    
    ➜  pdf:  evince my pdf.pdf    
    Error: May not be a PDF file (continuing anyway)
    Error (30): Illegal character '{'
    Error: PDF file is damaged - attempting to reconstruct xref table...
    Error: Couldn't find trailer dictionary
    Error: Couldn't read xref table
    

    Can anybody help me with solving this issue and to fix this?

    • Eric Carvalho
      Eric Carvalho about 11 years
      Are you sure the file isn't corrupted? What's the output of pdfinfo <file>.pdf?
    • Derrick Mar
      Derrick Mar about 11 years
      I see these errors: Error: May not be a PDF file (continuing anyway) Error (30): Illegal character '{' Error: PDF file is damaged - attempting to reconstruct xref table... Error: Couldn't find trailer dictionary Error: Couldn't read xref table
    • Derrick Mar
      Derrick Mar about 11 years
      Being this file corrupted is my nightmare, and I think it's coming true. Just hoping for a way to get the content back. :(
  • Derrick Mar
    Derrick Mar about 11 years
    I did try to change extension to .pdf, but it seems that there is no other way to get the data back. I think I'll have to live with accepting the fact that the file is corrupted. :(
  • Fakhri Zulkifli
    Fakhri Zulkifli over 10 years
    And still no one know the solution for this annoying problems? it seems the corrupted or damaged pdf file can't be recovered
  • BiggJJ
    BiggJJ over 10 years
    Maybe some of these methods? superuser.com/questions/278562/…
  • Sildeag
    Sildeag over 2 years
    I had one .pdf file which generated same message and others indicating - a corrupted file. Unable to open it using LibreOffice components, Google browser, and file reader. Firefox browser was able to open it and it turned out to be a scanned document. Printed it using PDF output printing option. The disadvantage with this is the PDF isn't searchable.