Pass document extension to display_document

This helps solve interoperability issues.