Viewer rendering logic

This logic diagram shows how the viewer determines a document type and how to display it.