Readonly in FlexPaperViewer

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
netops
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Wed Aug 24, 2016 11:23 am

Readonly in FlexPaperViewer

Post by netops » Sat Sep 03, 2016 12:06 pm

I am using openkm-6.3.0 community edition on Centos-6.5 with viewer FlexPaperviewer.

Basically it gives print & copy option while preview the document. My requirement is that user can't print & copy the document through preview. As per openkm forum references it can be achieved by enabling readonly=true in flexpaper viewer that is possible in commercial version only. Please suggest will it possible to integrate commercial version FlexPaperviewer with community edition openkm-6.3.0? If yes, please provide the steps and where we can get commercial version FlexPaper that will work with Openkm-6.3.0.

Please advise or provide any alternate solution for this requirement.

OS - Centos 6.5 x64 Bit
OpenKM Version- 6.3.0 Community Edition.
Browser - IE8-11, Chrome & Mozilla.

jllort
Moderator
Moderator
Posts: 9702
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Readonly in FlexPaperViewer

Post by jllort » Sat Sep 03, 2016 3:40 pm

It's possible integrating flexpaperview, basically must overwrite non commercial version by commercial version and then make a minor change in a Utils.java class and the method you should be interested in modifying is named createPDFViewerFlexPaper
https://sourceforge.net/p/openkm/code/H ... /Util.java

I suggest for making the change user our OpenKM portable development edition at https://sourceforge.net/projects/openkmportabledev

netops
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Wed Aug 24, 2016 11:23 am

Re: Readonly in FlexPaperViewer

Post by netops » Mon Sep 05, 2016 11:39 am

Hi jillort,

Thanks for reply. Could you please advise about costing on commercial version of flexpaperviewer with readonly & without readonly (both edition) and what minor changes need to do in java utils. You may reply all these things on netops1@xxxyyy.com also if anything prevent you to share these details at open forum.

Please feel free to revert in case further information needed from my side.

jllort
Moderator
Moderator
Posts: 9702
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Readonly in FlexPaperViewer

Post by jllort » Tue Sep 06, 2016 12:06 pm

I have removed your mail address for preventing spam etc...

I do not exact remember the cost of the flexpaper license, but sure it was less 1000$.

I observe the website has changed http://flexpaper.devaldi.com/, now is https://flowpaper.com/ you should be interested on it https://flowpaper.com/annotate-pdf-documents-online.jsp ( you can try here https://flowpaper.com/download.htm )

You can also take a look here https://github.com/flexpaper/flexpaper

netops
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Wed Aug 24, 2016 11:23 am

Re: Readonly in FlexPaperViewer

Post by netops » Tue Sep 06, 2016 1:47 pm

Thanks jllort for valuable effort in this regard.

Could you please advise the changes that needs to done in Utils.java (as per your past thread in this post), etc in OpenKM while integrating it with FlexPaperViewer. I have found one document at http://vigrond.com/blog/2011/06/05/prot ... laceHolder duing googling. Here vigrond had described the steps to disable print option in flexpaperviewer.

It would be helpful if you guide the changes needed in OpenKM for changed flexpaperviewer.

jllort
Moderator
Moderator
Posts: 9702
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Readonly in FlexPaperViewer

Post by jllort » Wed Sep 07, 2016 8:09 am

I have seen it https://flowpaper.com/parameters.jsp ( in commercial flexpaper there's a parameter named PrintEnabled : printEnabled, )

In professional edition the flexpaper method is:

Code: Select all

public static native void createPDFViewerFlexPaper(String pdfUrl, String width, String height, String printEnabled,
			String licenseKey, String flashId, String container) /*-{
		if (printEnabled == 'true') {
			fpViewer = "../js/flexpaper/FlexPaperViewer.swf";
		} else {
			fpViewer = "../js/flexpaper/FlexPaperViewerRO.swf";
		}
		
		pdfUrl = encodeURIComponent(pdfUrl);
		$wnd.swfobject.embedSWF(fpViewer, container, width, height, "10.0.0", "playerProductInstall.swf",
			{
				SwfFile : pdfUrl,
				Scale : 1.0,
				key : licenseKey,
				ZoomTransition : "easeOut",
				ZoomTime : 0.5,
				ZoomInterval : 0.1,
				FitPageOnLoad : false,
				FitWidthOnLoad : false,
				PrintEnabled : printEnabled,
				FullScreenAsMaxWindow : false,
				ProgressiveLoading : true,
				
				// PrintToolsVisible : printEnabled,
				ViewModeToolsVisible : true,
				ZoomToolsVisible : true,
				FullScreenVisible : true,
				NavToolsVisible : true,
				CursorToolsVisible : true,
				SearchToolsVisible : true,
				localeChain: "en_US"
			},
			{
				quality : "high",
				bgcolor : "#ffffff",
				allowscriptaccess : "sameDomain",
				allowfullscreen : "true"
			},
			{
				id : flashId,
				name : flashId
			});
	}-*/;

ulinuha
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: Mon Nov 13, 2017 9:08 am

Re: Readonly in FlexPaperViewer

Post by ulinuha » Mon Nov 13, 2017 9:41 am

netops wrote:
Tue Sep 06, 2016 1:47 pm
Thanks jllort for valuable effort in this regard.

Could you please advise the changes that needs to done in Utils.java (as per your past thread in this post), etc in OpenKM while integrating it with FlexPaperViewer. I have found one document at http://vigrond.com/blog/2011/06/05/prot ... laceHolder duing googling. Here vigrond had described the steps to disable print option in flexpaperviewer.

It would be helpful if you guide the changes needed in OpenKM for changed flexpaperviewer.
Now it works:
Capture.PNG
Thanks for your information to vigrond.com page.
In order to use his modified readonly flexpaper swf file (file attached), you should modify some part of one line in several *.cache.html file inside folder: "...\tomcat-7.0.61\webapps\OpenKM\frontend". PS: Each cache html file will be used for different browser, so you need to update all of the files in order to make it works in every browser.

for example in file: 7F2226E203FD85C8A6200A1D5F8CE418.cache.html
you should change line 10633:

{SwfFile:a,Scale:0.6,ZoomTransition:'easeOut',ZoomTime:0.5,ZoomInterval:0.1,FitPageOnLoad:false,FitWidthOnLoad:true,FullScreenAsMaxWindow:false,ProgressiveLoading:true,ViewModeToolsVisible:true,ZoomToolsVisible:true,FullScreenVisible:true,NavToolsVisible:true,CursorToolsVisible:true,SearchToolsVisible:true,localeChain:'en_US'}

into:

{SwfFile:a,Scale:-0.6,ZoomTransition:'easeOut',ZoomTime:0.5,ZoomInterval:0.1,FitPageOnLoad:false,FitWidthOnLoad:true,PrintEnabled:true,MinZoomSize:0.2,MaxZoomSize:8,InitViewMode:'Portrait',ViewModeToolsVisible:true,ZoomToolsVisible:true,NavToolsVisible:true,CursorToolsVisible:true,SearchToolsVisible:true,localeChain:'en_US'}

After make a modification, refresh your browser and ensure that your browser doesn't load swf file & *.cache.html file from cache.
Once you're sure that it works, goto folder "...\tomcat-7.0.61\webapps" find file OpenKM.war. open it with winrar, navigate to frontend folder. upload your modified *.cache.html files into this folder. this is to ensure that once openkm.war refresh our website, it replaces with the modified one.

I attached my modified cache.html files that you can use.
BEFORE MAKE ANY CHANGES, DONT FORGET TO MAKE BACKUPS!

Anyway, this modification won't prevent user to download the files since while user access the openkm from mobile/ phone, its default action is downloading the file and view it using default external application instead of using flash viewer like in desktop browser. Any solution about this (without discarding the ability to access openkm from mobile)?
Attachments
frontend3.rar
(865.96 KiB) Downloaded 3 times
frontend2.rar
(783.71 KiB) Downloaded 3 times
frontend1.rar
(864.67 KiB) Downloaded 3 times
FlexPaperViewer.zip
modified readonly swf file
(392.03 KiB) Downloaded 3 times

jllort
Moderator
Moderator
Posts: 9702
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Readonly in FlexPaperViewer

Post by jllort » Tue Nov 14, 2017 3:44 pm

Please do a fork of openkm project and then make the modifications in your branch and when you got it ask for a merge request into 6.3-DEV
https://github.com/openkm/document-management-system

Take in consideration we have removed flexpaper viewer and we have updated with newer what works in HTML5 ( that is caused because non comercial version of flex paper only works with flash player what will no longer be supported by browsers ).

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests