CenterForOpenScience / modular-file-renderer

A Python package for rendering files to HTML via an embeddable iframe
http://modular-file-renderer.readthedocs.io/en/latest/
Apache License 2.0
44 stars 67 forks source link

[SVCS-488] Improve docx rendering - MFR Part #304

Open cslzchen opened 6 years ago

cslzchen commented 6 years ago

Ticket

https://openscience.atlassian.net/browse/SVCS-488 OSF side PR: https://github.com/CenterForOpenScience/osf.io/pull/8002

Purpose

This ticket replaces https://github.com/CenterForOpenScience/modular-file-renderer/pull/282. Credit goes to @AddisonSchiller 🎆🎆.

.docx rendering is very intensive on the OSF. By using Microsoft's online rendering service to render publicly available .docx files, we can remove a lot of pressure from the unoconv container.

Changes

Side Effects

QA Notes

The Office365 renderer does not use the.pdf renderer like unoconv used to, so the pdfs that get made by this renderer may not display exactly the same. More QA notes to come. There is also a README.md in the renderer with more information about testing.

Deployment Notes

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.1%) to 67.896% when pulling 02468e1941681f61e065415740257a56279f0478 on cslzchen:feature/svcs-488-improve-docx into 8bb2dd4d35f8c1d89a72fc8b9e09db317f3497f3 on CenterForOpenScience:develop.

cslzchen commented 6 years ago

Note: this PR cannot be tested locally since Office rendering service requires a public available file. Here is what shows up locally, and sandboxing does not cause any issue. src is https://view.officeapps.live.com/op/embed.aspx?src=http%3A//192.168.168.167%3A7777/v1/resources/2n3gt/providers/osfstorage/5a283b61a4a094002587bea3 as expected. The error is due to the service having no access to the local file.

screen shot 2017-12-07 at 11 22 21 am

Here is what shows up locally when hard-coding a staging download url with with iframe sandboxing turned on. src is empty for iframe due to sandboxing.

screen shot 2017-12-07 at 11 18 36 am

Here is what shows up locally when hard-coding a staging download url with iframe sandboxing turned off. src is "https://view.officeapps.live.com/op/embed.aspx?src=https%3A//staging-files.osf.io/v1/resources/swy3c/providers/osfstorage/5a29638421b9f2000d8f0a16".

screen shot 2017-12-07 at 11 17 48 am

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.1%) to 67.894% when pulling 2eec820406bd15d438efbb718636edd663fd414f on cslzchen:feature/svcs-488-improve-docx into 8bb2dd4d35f8c1d89a72fc8b9e09db317f3497f3 on CenterForOpenScience:develop.