Mr.Web
Mr.Web

Reputation: 7154

FPDF error: Unable to find "startxref" keyword

I have an app that renders PDFs with FPDF.

It was working fine and for some reasons I had to change the PDF files and now I get this error:

Unable to find "startxref" keyword

enter image description here

If I restore the original files, the same error happens.

How do I fix this error?

Upvotes: 10

Views: 25627

Answers (3)

YOGO
YOGO

Reputation: 551

The problems lies (sometimes) in the pdf compression.

If you are using linux you can use this to uncompress the pdf:

 podofouncompress compressed.pdf decompressed.pdf

Upvotes: 1

Erique Bomfim
Erique Bomfim

Reputation: 449

I faced this problem recently. I'm using TCPDF to merge uploaded pdf files. Curiousilly something went wrong when importing some pdf files. Some cases, following error was printed:

Unable to find "startxref" keyword. in pdf_parser->_findXref()

So I tried to solve by reopen these pdfs files in Google Chrome and save it as PDF again. For my surprise, TCPDF worked! I still dont know how it can be but now I got a temporary solution.

Upvotes: 1

Jan Slabon
Jan Slabon

Reputation: 5058

You simply have to pass a local path instead of an URI to setSourceFile().

Upvotes: 6

Related Questions