Requirement:
Huge PDF (+/- 100MB) must be previewed on the frontend immediately.
Problem description:
Our current implementation take the whole document and extract the pages from it.
1. getPagesFromDocument
2. delete pages before the limit
3. delete pages after the limit
4. create the doc from the rest.
Questions:
1. Is it possible to provide just few pages of the PDF (given by the limit and offset) without the need to load the whole doc into memory (when X users concurrently ask for the part of the document memory is exhausted)
2. Is it possible to solve requirement in a different way?