July 21st, 2013, 09:11 AM
Help inflating PDF streams
I have a PDF file I need to manipulate inside a Sencha web APP.
I thought to take advantage of the incremental update features of the PDF format to add these highlights. but to do that I need to be able to read the content of the file and have correct references in the xref table of the PDF.
I read the file using an AJAX call then load the responseText in to a string so I can search, update and manipulate the text.
The problem is that some of the objects are compressed into streams using /Filter/FlateDecode, that makes the data in that stream unreadable and the references in the string I use to manipulate the PDF incorrect.
I need to inflate the encrypted streams to get a simple text file I can work with.
I tried to use zLib.js to inflate the encoded section with no success. I also tried to convert it to different encoding etc. but had no success.
Maybe a library which is already able to do what I need to do ?