PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com _____________________________________________________________
> I am working on an application to decode and reencode the encoded > data > in the pdf..and am using third party encoding/decoding libraries > for > this. > now the problem is..I am not able to decode the lzw buffer in > pdf.. > i get the error bad compressed format..but if i rip off initial > 2 > bytes the buffer gets decoded. Also I am able to decode the > buffer > even if i rip off till 5 bytes..is the lzw buffer contained in > some > header like flate buffer or whats going wrong..? Are you carefully following the strict rules for white space to skip after the "stream" keyword? > > One more issue...i decode the flate buffer..reencode it..the new > encoded data is not same as that of the pdf encoded data.. This is normal. There are many different valid Flate streams from the same input data. > so i am not able to reopen the regenerated pdf file That should not cause it. You probably have other issues like - wrong whitespace after "stream" - failing to rebuild xref table correctly - failing to update Length keyword correctly You can start, though, by making your program dump a copy of the decompressed data to a log file. You can look to see if it is reasonable, and whether it has changed. Aandi To change your subscription: http://www.pdfzone.com/discussions/lists-pdfdev.html
