Is it possible to add a preview of a document in the Plumsail Form connected to a document library?
Dear @Pieter,
It's very easy to do for PDF files as browser's can render them effortlessly, but not so easy to do for Word, and other Microsoft documents.
Which ones do you need?
Hi Nikita,
Thanks for your quick response. I need them both, PDF and Office Documents like Word, Excel and Powerpoint. We would like an interactive preview like you get when you open the details pane:
Dear @Pieter,
As I've said, the PDF one is super easy - the rendering of a PDF document all handled by the browser. Simply add an HTML control with the following code to the form:
<iframe id='fd_docview' width='1366px' height='623px' frameborder='0'></iframe>
Then, add the following JavaScript to JS editor (change Document Library title to match yours):
fd.spRendered(function() {
var library = pnp.sp.web.lists.getByTitle("Documents");
library.items.select("FileLeafRef", "FileRef").filter("Id eq " + fd.itemId).get().then(function(items) {
$("#fd_docview").attr("src", items[0].FileRef);
});
});
Here's the result:
As for MS Office documents - this will be trickier!
Our developers will have to research this question, and most likely spend some time to write the code. If you're interested and would consider paid support for this feature, write us at support@plumsail.com, we'll estimate the hours needed to make this possible.