Live data from Hacker News

Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

github.com

51–59 of 59 posts

Re: Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

#53
post #30

So I just tried this with a bunch of medium-complex documents and it's wildly wrong. I suspect the authors have never seen an actually complicated Word document?

[flagged]

I don't know why this was flagged, but you are right.

Google Docs [1] and OnlyOffice [2] also employ the canvas method to render office documents, and have found it reliable and consistent among different browsers.

[1]: https://workspaceupdates.googleblog.com/2021/05/Google-Docs-...

[2]: https://helpcenter.onlyoffice.com/faq/technology.aspx

Re: Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

#54
post #25
post #11

If someone actually got "pixel-faithful" Office documents rendering correctly, MS would be screwed. That's actually really important for a lot of companies that carry around decades-old templates that never look exactly right in LibreOffice or any other software that attempted to replicate it. The slightest misalignment of a paragraph means a line on page 27 of 120 now moved down by 2 pixels, screwing everything else…

I've heard that the same file can render differently in MS Word across different machines and OSs. So, that won’t help either.

I would be very surprised if that's the case. I heard from a buddy that used to work in Office back when SDETs were a thing. They had labs of random machines rendering the same files (out of a library of thousands) and comparing the actual pixels for regressions.

Of course, that was a decade ago, so who knows.

Re: Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

#55
post #53

Earlier quoted context omitted.

[flagged]

I don't know why this was flagged, but you are right. Google Docs [1] and OnlyOffice [2] also employ the canvas method to render office documents, and have found it reliable and consistent among different browsers. [1]: https://workspaceupdates.googleblog.com/2021/05/Google-Docs-... [2]: https://helpcenter.onlyoffice.com/faq/technology.aspx

The account is flagged because it's a bot account.

Re: Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

#56

Earlier quoted context omitted.

For “pixel-faithful” documents it doesn’t seem to be replicating documents all too well based on the many other testimonies in these comments

>doesn’t seem to be replicating documents all too well based on the many other testimonies in these comments Ironic, that you are agreeing with a post saying they put in little effort for the implementation when you have put in absolutely no effort in saying that it doesn't produce pixel-faithful documents, such as producing a single concrete example.

[deleted]

Re: Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

#57
post #27

I literally had to solve the "preview Office files in the browser" problem last week. I couldn't find a decent solution, so I ended up making a endpoint that ran the files through headless libreoffice on the server to convert them to PDF. For PPTX and DOCX, this solution is slightly worse than libreoffice conversion (this does not appear to output highlightable text, while PDF conversion does). However, the XLSX prev…

[flagged]

Re: Office-open-xml-viewer: Office XML document viewer that renders to HTML Canvas

#58
post #30

So I just tried this with a bunch of medium-complex documents and it's wildly wrong. I suspect the authors have never seen an actually complicated Word document?

Do you have any actual examples of documents where it did not work?

My examples are all internal/confidential, but if someone from the project wants an example I could probably do some search/replace redaction. It would be a lot of work though because there's photographs and such too, and indexes, and tables, and documents inserted by reference, cross references, conditional fields, bibliography fields, formula fields, etc etc.
Post reply on HN