jtanadi / scotty

WebSocket-enabled PDF viewer
http://raa-scotty.herokuapp.com/
MIT License
15 stars 1 forks source link

Viewing complex PDFs is slow #39

Closed jtanadi closed 4 years ago

jtanadi commented 4 years ago

PDFs with complex (eg. architectural) drawings feel sluggish. This isn't a network issue or document length issue since the app displays one page at a time. Might be a rendering issue; and part of the sluggishness might be because rendering is a blocking event (ie. buttons don't feel as responsive).

Some thoughts / to dos:

jtanadi commented 4 years ago

Possible Solution: Convert PDFs to images

Looking at other projects (eg. Fermat's Last Margin and Procore), it might be best for PDFs to be converted to images server-side. The client would then only need to render images, which will be more performant.

Caveat

With this solution, texts will not be rendered as texts. An app like Procore deals with this by separating the text layer from the drawing layer in the PDF. Drawings are sent to the front end as images and the text layer is displayed as native text superimposed on the image.

jtanadi commented 4 years ago

First stab at a microservice that converts PDFs to PNGs and uploads files to S3: https://github.com/raa-tools/conveyor