2

Is there a way to open a PDF document using JavaScript (or C#) and have it automatically open with Acrobat, let the user edit document and upon the the user closing document, save back to server.

From my research, I found people recommend iTextsharp, but I don't think that will do what I'm trying to accomplish.

Basically I am trying to mimic the Check Out/Check In functionality of SharePoint.

Arm0geddon
  • 466
  • 11
  • 30
  • 3
    Wonder how SharePoint actually does that then... – Arm0geddon Jun 26 '13 at 14:58
  • You can create a PDF Form with a submit button inside. A submit button has several options, you can either send the whole filled PDF, or just send the (name,value) pairs as an http post.You can then embed this file on a web page (using acrobat reader), – yms Jun 26 '13 at 15:06
  • If the modifications you want to do go further than filling out forms, then I think you might need to give up. – yms Jun 26 '13 at 15:46
  • where this pdf document is ? As far as i understand this pdf document is at server side ? Is this the case ? – Abhishek Gahlout Jul 03 '13 at 06:24
  • Yes, it's on the server. – Arm0geddon Jul 03 '13 at 14:42
  • on Sharepoint that check in/out only works with IE... which tells me it may be something like ActiveX or other proprietary items – gudatcomputers Jul 03 '13 at 20:13
  • According to Acrobat documentation, I would say that it's a build-in functionality of Acrobat. It knows when it is about to open a document from Sharepoint and then give you the Check In button. On the Sharepoint side, it offers an access to Acrobat to download back the file after save without actions from the user. I'm not sure there is really a solution to do the same, else than maybe do some Acrobat plugin to replicate this behaviour. – Gregoire D. Jul 04 '13 at 13:18

4 Answers4

4

A lot probably depends on what exactly you are trying to accomplish and how much control you have over your environment / users. Looking at what Acrobat X and SharePoint do, it looks like support for SharePoint is built into Acrobat X.

This can easily (well :-)) be done by creating an Acrobat plug-in. Plug-ins are capable of monitoring a myriad events within Adobe Acrobat and reacting on that. They can do complex things such as adding a file system (which allow you to open and save files that are actually stored in a database for example) but there are certainly more simple strategies imaginable.

Imagine a plug-in living in Adobe Acrobat that monitors each file that is opened by the user. Upon seeing a file opened from your server it marks that document as one of yours and checks it out with the server (however you want to implement that). When the user saves the document that notification would be received as well (both before and after the actual save) and again appropriate action can be taken.

So the general answer is yes, this is doable under certain circumstances, if you are willing to write a plug-in and if you have control enough over your environment that you can make sure all users actually have this plug-in installed in Adobe Acrobat.

David van Driessche
  • 6,602
  • 2
  • 28
  • 41
3

To save document back to SharePoint there should be support in client application. If I correctly understand Acrobat X supports this http://pdfdevjunkie.host.adobe.com/pdf/AcrobatXandMicrosoftSharePoint.pdf . Isn't that that are you looking for?

trigras
  • 515
  • 6
  • 18
3

Ignoring the browser, so assuming you're working in a C# application, this is quite possible and not as complex as it might seem. The details will depend on your exact setup, but I'd suggest a la:

Community
  • 1
  • 1
El Zorko
  • 3,349
  • 2
  • 26
  • 34
1

As I am aware there is no JS solutions to edit PDF (26.06.13), but there is a way to preview them, for example with pure JS solution PDF.JS.
You need to generate PDF files on server side using pure submitted data.

moka
  • 22,846
  • 4
  • 51
  • 67
  • I'm not trying to generate PDFs. I just what the PDF to open in Acrobat, and save back to the server, like SharePoint. – Arm0geddon Jun 26 '13 at 15:10
  • In web it wont be possible as "save back" - is: open > edit > save (generate) > upload. And this is not in functionality of PDF Readers. As I've mentioned, you can send raw data from sort of form to server and generate PDF there - is one of options to go. There is no way to "save" PDF, there is only way to "generate" it. – moka Jun 26 '13 at 15:22