You are viewing limited content. For full access, please sign in.

Question

Question

Retain Zoom on small documents in LF

asked on May 31, 2019

Hello,

We have a user that is in the process of transitioning to LF. They had a previous solution that had a feature called “Retain Zoom,” which is a button used for very small documents like receipts and slips. The users would zoom in on the doc, hit this button and that specific document remembers to always open in a Zoomed in view, but the rest open in page height mode. 

I haven't heard of any feature like this in Laserfiche, but perhaps there is something I don't know about. Do you know of any way to imitate this behavior in LF? Not sure a workflow would be the right tool for this?

0 0

Replies

replied on May 31, 2019

If you are using Laserfiche Web Client's PDF Viewer, you may do so with a custom script. 
* This is tested on Chrome / Laserfiche Web Client 10.4 and may not work with other version without adjusting.

 

From Web Client Options, Add the following two Custom Actions

1- Name: PDFViewerZoom Save

Location: Document Viewer toolbar

Command:

var docViewerDoc = frames[3].document
var docViewerURL = docViewerDoc.location.href;
if (docViewerURL!='' && docViewerURL.indexOf('PdfViewer')>0) {
	var entryId = webAccessApi.getFocusedEntries()[0].id;
	var scale = frames[3].PDFViewerApplication.pdfViewer.currentScale;
	localStorage.setItem('Zoom-'+entryId, scale);
}

 

2- Name: PDFViewerZoom Load

Location:  Document Viewer toolbar

Command: 

var docViewerDoc = frames[3].document
var docViewerURL = docViewerDoc.location.href;
if (docViewerURL!='' && docViewerURL.indexOf('PdfViewer')>0) {
	var entryId = webAccessApi.getFocusedEntries()[0].id;
	var scale = localStorage.getItem('Zoom-'+entryId);
	frames[3].PDFViewerApplication.pdfViewer.currentScale = scale;
}

Enable script:

if (typeof top.alreadyZoomed == 'undefined') {
 top.alreadyZoomed = true;
setTimeout(function() {
var docViewerDoc = frames[3].document
var docViewerURL = docViewerDoc.location.href;
if (docViewerURL!='' && docViewerURL.indexOf('PdfViewer')>0) {
	var entryId = webAccessApi.getFocusedEntries()[0].id;
	var scale = localStorage.getItem('Zoom-'+entryId);
	frames[3].PDFViewerApplication.pdfViewer.currentScale = scale;
}
}, 2000); // auto zoom after 2 seconds, Adjust timer to accommodate network speed

}
return true;

 

After saving, move these custom actions from [Under More Actions button] to [On toolbar].  This script is going to save the Zoom setting when the user clicks the Save Button and associate it with that Entry Id. The setting will be saved in Browser's local storage. So it will reset if user change browser or clears local storage. 

This is a very simple script so modify it if you want more advance way of handling that, and in overall; Use this script as an idea on how that feature can be implemented. 

1 0
replied on May 31, 2019 Show version history

The client doesn't have a feature like that. However, you can probably just set the default zoom to a setting that will ensure that small documents are always zoomed in.

The Window Size setting might be appropriate.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.