I’ve based our viewer front-end on the ModrenUI example from https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET-MVC-App.
I’ve made changes in our implementation to do things that your old installable viewer knockout.JS implementation did - such as load pages as the user scrolls to them, rotate pages, zoom in/out/fit to width and height and display the md-card elements using the page size returned from ViewerHtmlHandler.GetDocumentInfo().
One thing I found was that the page sizes returned in the DocumentInfoContainer are in pixels (as stored in fd.xml), but all of the HTML is in em units - so I had to deduce what 1em was in pixels inside your ViewerHtmlHandler.GetPages().
This works fine for emails, attachments, PDFs and Word documents - but not for text files.
This can be demonstrated with the Modren UI example code.
- Clear the AppData\cache folder.
- Extract test2.txt from the attached zip file Test2.zip to the AppData folder.
- Run the Modren UI example and choose Test2.txt.
- Examine App_Data\cache\Test2_txt\html\fd.xml to get the page size in pixels - 612 x 792 - which equates to US Letter size at 72DPI.
- Using the browser developer tools, set the width and height of the md-card element to 612 x 792 pixels.
- See that the text is offet to the right and off the side of the page.
The reason for this when examining the HTML in App_Data\cache\Test2_txt\html\page1.html seems to be that the page size is used for the parent div - in this case
Please can you advise how I can either get 612pt to be 612 pixels in all browsers, or how to force text file elements to be sized in em the same as other file types?