Closed jtanadi closed 4 years ago
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.
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.
First stab at a microservice that converts PDFs to PNGs and uploads files to S3: https://github.com/raa-tools/conveyor
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:
react-pdf-viewer
.