Afternoon,
I am trying to make it so PDF files are viewable but not printable or downloadable (e-learning). Have tried a number of possible solutions on the forums / documentation without too much joy. I then stumbled across Adobe PDF embedding which does exactly what I (we) need.
I have managed to get it working locally but need to delete the .htaccess file as the files are in the secure file folder. When I do that it works great, but defeats the purpose.
I have tried it with cloaking the URL(S) but just get a file not found error. Have tried cloaking the initial URL,the 2 in the viewer file and a mixture of them with not luck, Can you please advise?
Code - Success Page. Loops through JSON (Array) of purchased courses. Passing the link to the file and name of the course but think i'll be dropping the name part.
PDF Viewer Code - Javascript Auto-Generated by Adobe just added the Couch tweaks.
The other reason for using the cloaking is the client only wants material to be accessable for a set period of time. Think its a simple thing, just having a slow day.
Thank you.
I am trying to make it so PDF files are viewable but not printable or downloadable (e-learning). Have tried a number of possible solutions on the forums / documentation without too much joy. I then stumbled across Adobe PDF embedding which does exactly what I (we) need.
I have managed to get it working locally but need to delete the .htaccess file as the files are in the secure file folder. When I do that it works great, but defeats the purpose.
I have tried it with cloaking the URL(S) but just get a file not found error. Have tried cloaking the initial URL,the 2 in the viewer file and a mixture of them with not luck, Can you please advise?
Code - Success Page. Loops through JSON (Array) of purchased courses. Passing the link to the file and name of the course but think i'll be dropping the name part.
- Code: Select all
<cms:each purchased.courses>
<li>
<a href="<cms:cloak_url link='<cms:show k_site_link />pdf-viewer.php?course_link=<cms:show item.course_link />&course_name=<cms:show item.course_name />' />" style="color:#234655;"><cms:show item.course_name /></a>
</li>
</cms:each>
PDF Viewer Code - Javascript Auto-Generated by Adobe just added the Couch tweaks.
- Code: Select all
<cms:template title="PDF Viewer" parent="_modules_" icon="" hidden="1" order="10" />
<cms:set course_link="<cms:gpc 'course_link' method='get' />" />
<cms:set course_title="<cms:gpc 'course_name' method='get' />" />
<div id="adobe-dc-view"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "b823990a282f42f49b424177466cb118", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content: {
location: { url: "<cms:show course_link />"}
},
metaData: {
fileName: "<cms:show course_link />" }
},
{
showDownloadPDF: false,
showPrintPDF: false
});
});
</script>
The other reason for using the cloaking is the client only wants material to be accessable for a set period of time. Think its a simple thing, just having a slow day.
Thank you.