Skip navigation
Currently Being Moderated

Problem with FlateDecode

Feb 28, 2011 4:14 PM

Some days ago I was trying to find a utility or a library in PHP that would let me extract the images... Seeing as after hours of googling I didn't find anything free and trustworthy, I decided to take up the challenge myself. After reading part of the reference, I tried to start writing some code to parse the objects (I'll read the rest when I need it).


Well, it turns out that right now I'm trying to apply the stream filters, and I'm having a problem with FlateDecode. I thought that I could use the default PHP function for zlib/inflate, but when I tried it, it threw me a data error. I checked that my code wasn't cutting chars off the stream; and I even tried reversing the predictor before inflating (even though if it's applied before encoding, it should be reversed after decoding). Then I went back on Google, and I couldn't find anything about more than one deflate implementation or about FlateDecode not being the same as zlib/deflate. So right now I'm not sure what's wrong...


The stream I was trying to decode was a cross-reference stream, and the file actually opens on Adobe Reader, so it's not a wrong encoding. (Though I must say it's a linearized document, perhaps it has something to do?)


Could anyone shed a little light on this?


More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points