I've setup an openlayers instance on a webpage which can load static images. These images are actually the pages of a PDF you can upload. There is a pagination option on it so users can navigate between pages and draw ( using openlayers draw ) on each page individually.
So far so good. I save each page vector layer as GEOJson and send the data back to the back-end. Keep in mind at this point I have both the original PDF and an array of GEOJson (one json for each page ).
At the moment I'm merging the two in the UI by using
and posting the base64 string for all pages back to the server to be loaded into memory and saved as PDF. But this way has a lot of downsides like, losing original document quality, a lot of OutOfMemoryExeptions, and it's super slow.
How can i merge the PDF file with the corresponding vector layer in the back-end?
This is an example of what I'm talking about :