Sharepoint 2013 PDF签出并打开选项启用 [英] Sharepoint 2013 PDF check out and open option enablement

查看:82
本文介绍了Sharepoint 2013 PDF签出并打开选项启用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sharepoint 2013中遇到了一个问题," PDF签出并打开选项"启用,

I am facing an issue in Sharepoint 2013 , " PDF check out and open option" enablement,

方案1. PDF  文件打开 SharePoint  库资源管理器视图,工作正常。

scenario 1. PDF file open from SharePoint Library Explorer view, It is working fine.

场景2.当PDF  文件从开始 SharePoint  图书馆标准视图,然后
它不工作。

Scenario 2. When PDF file open from SharePoint Library standard view, then It is not working.

为了解决这个问题,我已经对DOCICON.xml进行了更改

In order to fix this issue, I have done the changes on DOCICON.xml

< 映射
= " pdf "
= " icpdf.png "
OpenControl = " Adob​​eAcrobat.OpenDocuments " />

<Mapping Key="pdf" Value="icpdf.png" OpenControl="AdobeAcrobat.OpenDocuments"/>

更新
OpenControl as" Adob​​eAcrobat.OpenDocuments ",然后它也无效。

updated OpenControl as "AdobeAcrobat.OpenDocuments",  then also it is not working.

正如文章中所见,这是Microsoft Share 2013中的错误

As found in article, this is something Microsoft bug in Sharepoint 2013

https:// forums。 adobe.com/thread/1379554

请帮我解决这个问题。

问候,

Sanjeev

推荐答案

是的,这是SharePoint 2013中的一个已知问题。这是因为JS没有调用ActiveX for PDF。

您找到的帖子是此问题的正确解决方法。

此解决方案的详细步骤:

1.打开记事本。

2。粘贴下面的脚本:

(function () {


    if (typeof SPClientTemplates === 'undefined')


        return;


    var PdfCtx = {};


    PdfCtx.Templates = {};


    PdfCtx.Templates.Fields = { 'LinkFilename': { 'View': PdfClientLinkFilenameNoMenu } };


    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(PdfCtx);


})();


function GetExtension(szHref) {


    var sz = new String(szHref);


    var re = /^.*\.([^\.]*)


/;


return(sz.replace(re,"
/; return (sz.replace(re, "


1"))。toLowerCase();


}


var stsOpen = null;


函数IsPdfClientInstalled(){


if(stsOpen == null){


if (Boolean(window.ActiveXObject)){


try {


stsOpen = new ActiveXObject(" PdfFile.OpenDocuments");


}


catch(e){


stsOpen = null;


}


}


}


return(stsOpen!= null);


}


函数OpenPdfInClient(pdfFileUrl){


var fRet = true;


try {


fRet = typeof stsOpen.ViewDocument2!=" undefined" &安培;&安培; stsOpen.ViewDocument2(window,pdfFileUrl,'');


}


catch(e){


fRet = false;


};


if(event!= null){


event.cancelBubble = true;


event.returnValue = false;


}


返回fRet;


}


函数PdfNewGif(listItem,listSchema,ret){


if(listItem) [" Created_x0020_Date.ifnew"] ==" 1"){


var spCommonSrc = GetThemedImageUrl(" spcommon.png");


ret.push("< spanms-newdocument-iconouter \">< imgms-newdocument-icon \" src = \"" );


ret.push(spCommonSrc);


ret.push(" \" alt = \"");


ret.push(Strings.STS.L_SPClientNew);


ret.push(" \" title = \"");


ret.push(Strings.STS.L_SPClientNew);


ret.push(" \" />< / span>"); b


}


$ b函数PdfClientLinkFilenameNoMenu(param1,param2,listItem,listSchema){


var ret = [];


var fileUrl = listItem.FileRef;


if(fileUrl!= null&& typeof fileUrl!='undefined'&& TrimSpaces(fileUrl)!=""){


if(listItem.FSObjType =='1'){


if(listSchema.IsDocLib =='1'){


RenderDocFolderLink(ret,listItem.FileLeafRef,listItem,listSchema);


}


else {


RenderListFolderLink(ret,listItem.FileLeafRef,listItem,listSchema );


}


}


else {


ret.push("< a href = \"");


ret.push(listItem.FileRef);


ret.push(" \" onmousedown = \" return VerifyHref(this,event,'");


ret.push(listSchema.DefaultItemOpen);


ret.push("','");


ret。 push(listItem [" HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon"]);


ret.push("','");


ret.push(listItem [" serverurl.progid"]);


ret.push("')\" onclick = \"") ;


var appInstalled = IsPdfClientInstalled();


var szExt = GetExtension(listItem.FileRef);


if(appInstalled&& szExt =='pdf'&& browseris.ie){


ret.push( "return OpenPdfInClient('");


ret.push(window.location.protocol +" //");;


ret.push(window.location.hostname);


ret.push(listItem.FileRef);


}


else {


ret.push(" return DispEx(this,event,'TRUE','FALSE','");


ret.push(listItem [" File_x0020_Type.url"]);


ret.push("','" );


ret.push(listItem [" File_x0020_Type.progid"]);


ret.push("',' ");


ret.push(listSchema.DefaultItemOpen);


ret.push(" ','");


ret.push(listItem [" HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon"]);


ret.push("','");


ret.push(listItem [" HTML_x0020_File_x0020_Type"]);


ret.push("','");


ret.push(listItem [" serverurl.progid"]);


ret.push("','");


ret.push(Boolean(listItem [" CheckoutUser"])?listItem [" CheckoutUser"] [0] .id:'');


ret.push("','");


ret.push(listSchema.Userid);


ret.push("','");


ret.push(listSchema.ForceCheckout);


ret.push("','");


ret.push(listItem.IsCheckedoutToLocal);


ret.push("','");


ret.push(listItem.PermMask);


}


ret.push("')\">");


var fileRef = listItem [" FileLeafRef"];


if(fileRef!= null){


var index = fileRef.lastIndexOf('。');


fileRef = index> = 0? fileRef.substring(0,index):fileRef;


}


ret.push(fileRef);


ret.push("< / a>");


PdfNewGif(listItem,listSchema,ret);


}


}


else {


ret.push("< nobr>");


ret.push(listItem [" FileLeafRef"]);


ret.push("< / nobr>");


}


返回ret.join('');


}
1")).toLowerCase(); } var stsOpen = null; function IsPdfClientInstalled() { if (stsOpen == null) { if (Boolean(window.ActiveXObject)) { try { stsOpen = new ActiveXObject("PdfFile.OpenDocuments"); } catch (e) { stsOpen = null; } } } return (stsOpen != null); } function OpenPdfInClient(pdfFileUrl) { var fRet = true; try { fRet = typeof stsOpen.ViewDocument2 != "undefined" && stsOpen.ViewDocument2(window, pdfFileUrl, ''); } catch (e) { fRet = false; }; if (event != null) { event.cancelBubble = true; event.returnValue = false; } return fRet; } function PdfNewGif(listItem, listSchema, ret) { if (listItem["Created_x0020_Date.ifnew"] == "1") { var spCommonSrc = GetThemedImageUrl("spcommon.png"); ret.push("<spanms-newdocument-iconouter\"><imgms-newdocument-icon\" src=\""); ret.push(spCommonSrc); ret.push("\" alt=\""); ret.push(Strings.STS.L_SPClientNew); ret.push("\" title=\""); ret.push(Strings.STS.L_SPClientNew); ret.push("\" /></span>"); } } function PdfClientLinkFilenameNoMenu(param1, param2, listItem, listSchema) { var ret = []; var fileUrl = listItem.FileRef; if (fileUrl != null && typeof fileUrl != 'undefined' && TrimSpaces(fileUrl) != "") { if (listItem.FSObjType == '1') { if (listSchema.IsDocLib == '1') { RenderDocFolderLink(ret, listItem.FileLeafRef, listItem, listSchema); } else { RenderListFolderLink(ret, listItem.FileLeafRef, listItem, listSchema); } } else { ret.push("<a href=\""); ret.push(listItem.FileRef); ret.push("\" onmousedown=\"return VerifyHref(this,event,'"); ret.push(listSchema.DefaultItemOpen); ret.push("','"); ret.push(listItem["HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon"]); ret.push("','"); ret.push(listItem["serverurl.progid"]); ret.push("')\" onclick=\""); var appInstalled = IsPdfClientInstalled(); var szExt = GetExtension(listItem.FileRef); if (appInstalled && szExt == 'pdf' && browseris.ie) { ret.push("return OpenPdfInClient('"); ret.push(window.location.protocol + "//");; ret.push(window.location.hostname); ret.push(listItem.FileRef); } else { ret.push("return DispEx(this,event,'TRUE','FALSE','"); ret.push(listItem["File_x0020_Type.url"]); ret.push("','"); ret.push(listItem["File_x0020_Type.progid"]); ret.push("','"); ret.push(listSchema.DefaultItemOpen); ret.push("','"); ret.push(listItem["HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon"]); ret.push("','"); ret.push(listItem["HTML_x0020_File_x0020_Type"]); ret.push("','"); ret.push(listItem["serverurl.progid"]); ret.push("','"); ret.push(Boolean(listItem["CheckoutUser"]) ? listItem["CheckoutUser"][0].id : ''); ret.push("','"); ret.push(listSchema.Userid); ret.push("','"); ret.push(listSchema.ForceCheckout); ret.push("','"); ret.push(listItem.IsCheckedoutToLocal); ret.push("','"); ret.push(listItem.PermMask); } ret.push("')\">"); var fileRef = listItem["FileLeafRef"]; if (fileRef != null) { var index = fileRef.lastIndexOf('.'); fileRef = index >= 0 ? fileRef.substring(0, index) : fileRef; } ret.push(fileRef); ret.push("</a>"); PdfNewGif(listItem, listSchema, ret); } } else { ret.push("<nobr>"); ret.push(listItem["FileLeafRef"]); ret.push("</nobr>"); } return ret.join(''); }

3。将记事本另存为PDFFIX.js到SharePoint服务器上的C:\Program Files \Common Files \ microsrosoft shared\Web Server Extensions \15\TEMPLATE \LAYOUTS。

4。使用PowerShell运行以下脚本:


这篇关于Sharepoint 2013 PDF签出并打开选项启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆