1

I am working on a web application which allows users to review pdf documents. These documents are submitted from another public facing website. A typical workflow involves:

  1. A document is uploaded on the public facing website and stored into document management system (DMS).
  2. The internal web application grabs the document from the shared DMS and shows it to the user.
  3. The user of the web application downloads this pdf to his local file system.
  4. He adds some markups/annotations/comments on the pdf.
  5. The reviewed document is submitted to the application, which processes the document and presents the corrections to the user who submitted the document on the website.

We were using a cloud service for manipulating the pdfs until now, so there was no problem accessing the reviewed pdf, as the API handled that. But some of the customers are having issues storing the pdfs on the cloud, so I need to implement a local solution.

My question is, how can my web-application know when the user has finished reviewing the document (which will probably be a save event), so it can fetch the document for processing. As far as I know, the server doesn't know anything about, and cannot access the local file system.

I can probably force the user to upload the reviewed document on the application, and that would make my life easy. But, from a usability point of view, and for a consistent user experience with the cloud solution; which allowed the communication on "save" event, I would like to have something similar, i.e. when the user hits save after reviewing, my application would like to grab the document for further processing.

I am not sure if there is a way around the server trying to access the local file system.

Note: It's an on-premise, enterprise web-application.

TL;DR: My web-application server would like to know when a document is saved locally, and grab that document.

1

If your users want to use a local application like Adobe Acrobat for editing the PDF files, there is no way around forcing them to upload the reviewed document. For well-known reasons of security, browsers cannot access or monitor the local file system directly (except within their sandbox, which has a local storage restriction of approx. 5MB), and everything which goes from and to the local file system requires an interactive acknowledgement from the user.

The only idea which could work in theory is to find a separate PDF editing component written in Javascript, directly as a web component, something like PDF.JS (which is only a PDF viewer), but for annotating PDF files. Such a component needs to hold the full PDF in main memory, without any server required for the edit process. I have no idea if something like that exists, you have to search for yourself, (or ask on https://softwarerecs.stackexchange.com/).

  • I see. Is there a way around this by using network shared directories, which can be accessed by both server and the clients? – Akshay Khot Jan 19 at 18:49
  • Assuming, when the user downloads the file, it goes into the shared directory, and then I can implement some sort of listener to handle the save event. But not sure if this is realistic and can be done. – Akshay Khot Jan 19 at 18:50
  • @AkshayKhot: you want a tight integration into the PDF saving process. So the key here is to have a PDF editing program which allows you to hook into the "save" event, or some similar customization. AFAIK Adobe Acrobat allows such customizations, so you may utilize this. However, then you do not have a web application here any more - you have an individual customization/plugin for a desktop software with all of its advantages and disadvantages like platform dependent code or necessity of deployment to all clients. If you go that route, the plugin can do in the background whatever you think ... – Doc Brown Jan 19 at 21:57
  • .. is necessary, like uploading the changed file to the server again in the background. No need to use a shared directory for this. – Doc Brown Jan 19 at 21:58
  • Okay, I think I will keep it simple and ask the users to upload the file into the application. Thanks for sharing the link to the happy programmer blog, it's a good resource. – Akshay Khot Jan 19 at 22:13

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.