XWIKI-6903: Office preview fails for PDF attachments
* Small refactoring in OfficeExporter.
* Use DefaultDocumentFormatRegistry instead of JsonDocumentFormatRegistry in office viewer tests.