Add support for document metadata and remove some unnecessary fields in pdf.Document.