mozilla/pdf.js — pull request #1413 by saebekassebil (2012-03-24 19:07:54+00:00)
Title: Metadata Parsing - Setting proper document title

This pull request implements a metadata parser for pdf.js - It looks for Metadata objects in the PDF file, and parses the metadata "understanding" it to some extent. Furthermore the viewer now has a access to the pdf file's metadata through `PDFViewer.metadata`.

I've added the parser to a new file called `metadata.js`

On thing that is open to discussion is how the parser handles the metadata entries. Right now most metadata information is just mapped directly into a metadata object, but maybe there's a problem with this. The metadata format for PDF files (XMP) makes it possible to use many different XML namespaces which have different meaning. It makes no sense to try to "understand" them all, but maybe the most used should be "properly" parsed and not just mapped like any other entry?