AutoDoc Uploads
# AutoDoc Uploads
I fixed those issues including some other fun stuff I found today, and I decided to test with a large 68MiB document.
When making a single change I found that it was taking PSPDFKit 43,594ms to export the PDF data - if the PDF-view is closed in that time then all data is lost. If I try to export the markup state using the XFDF it takes 5,362ms seconds to export. If I however use PSPDFKit’s instantJSON export - it exports all the markup as a separate JSON object in 5-9ms.
What I feel is a good solution which may take some time to implement is to upload the markup JSON obejct as a separate “hidden” file to DocAPI. Which also means that our network usage for markup changes will be really small since we only upload this small markup JSON obejct on any change. Our very-quick solution is that if the export takes longer than a few seconds, then we display a message and freeze the entire app until the exports are done.
It isn’t very well tested - but I’ve just rewritten things so that markup is written to a different file named ___markup___[hash_of_file_name].json though what exactly this file is named is up for changes.
This could be extended so that the docapi view hides these files.
Things that would need to be handled is the download button being updated to merge the markup JSON into the PDF, renaming/deleteing/replacing files in clients, etc.
It is feasible - but am not certain if it’s the best course of action.