Friday, June 03, 2011

Edit Document with Adobe “PDF” Files with https:// in SharePoint

Yep SharePoint can be a box of surprises…
This was the Problem,
I have one Farm with SharePoint 2010 installed and all the configurations to add the icon and customizations to open the Adobe Acrobat Document as Client Side, this Farm use the “http://” protocol and everything work fine and nobody complains, life run happy.
Then I have other Farm with the same configurations but the only difference is protocol to web application using “https://”, every time I try to edit the PDF File always return error…?!
image image
After this problem I tried to investigated about the configurations trying to identify what I did wrong using the “OpenControl” action in the Mapping to PDF files.
I also configure in the Central administration the General Settings of the Web Application to use the “Browser File Handling” to “permissive”  but this action will only open the PDF file in the Browser, the main question is open the “Adobe Acrobat” File as Client Side for edition, example: PDF Signatures
But nothing work….
image imageimage
After received this error I tried to understand what this Action associated in the popup menu “Edit in Edit Document” is doing, I used the Internet Explorer Developer Tool, this tool came with Internet Explorer and will help identify bad references JavaScript and CSS and made some change on real time of html properties, this can be fun if you want to make some security validations, I already found big security leaks in Sites just working with this tool.
image
The command action with parameter 0 ”in red”, will open the Adobe Document as Client Side but with error.
-> editDocumentWithProgID2('/Teste/Revista_PROGRAMAR_26.pdf', '', 'SharePoint.OpenDocuments', '0', 'http://[Site]', '0')
Then I try to change the command action with parameter 1 ”in red”, will Check-out the Document as draft in local computer and open in Adobe Acrobat as Client Side and Worked Smile.
-> editDocumentWithProgID2('{ItemUrl}', '', 'SharePoint.OpenDocuments', '1', '{SiteUrl}', '0');return false;
This site will help you configure the Custom action using some URL Tokens to configure the URL Action
How to: Add Actions to the User Interface
http://msdn.microsoft.com/en-us/library/ms473643(v=office.12).aspx
Create a new Feature for the new custom action to Edit Document 

image

After create the Feature associate one element.xml file, this file are defined the Custom Actions associated to our SharePoint site.

image

After deploy the solution I access to Document Library and the new option “Edit Document” appear.

imageThen I select new option “Edit Document” asking to Check out the PDF File and open as Client Side, done…Smile

imageimage

If you access again to the Document Library the Document is Check Out, assume the changes made in Adobe Acrobat file, you will need to check in to shared with users.


imageCustom Edit Document Solution Link
Hope you likeSmile

One interesting update about this subject and how you can create your custom opencontrol:
Using custom OpenDocuments control to open custom file types in SharePoint
http://blogs.msdn.com/b/malag/archive/2010/05/13/using-custom-opendocuments-control-to-open-custom-file-types-in-sharepoint.aspx
Post a Comment