简体   繁体   中英

Open PDF with javascript

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.

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.

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?

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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM