Allow raw PDF objects to be retrieved in display layer.

There should be a way to retrieve the raw PDF objects in a PDF file using PDF.js. This is both useful for inspecting PDF as well as being able to edit PDF files using incremental updates outside of PDF.js (see an example below; my further goal is to be able to add annotations to PDF files).

In previous versions of PDF.js, this was possible by using PDFDocument.xref.fetch() directly as done by pdf.js.utils. PDF.js versions using a Web Worker no longer exposed an API for this.

A demo demonstrating the new API can be found at:

http://ebenda.org/2014/pdf.js.utils/browser/ (updated pdf.js.utils including the possibility to extract raw PDF streams (e. g. click downloadRaw on a DCTDecode/JPEG image) and generate PNG files out of some FlateDecode images (only results in a valid PNG file if a Predictor is present), source at https://github.com/rgieschke/pdf.js.utils ).

http://ebenda.org/2014/pdf-update/build/generic/web/viewer.html (viewer including the possibility to delete the first page of a PDF file, source at https://github.com/rgieschke/pdf.js/blob/pdf-update/web/update.coffee ).


there is also obj.streams