Page 1 of 1

PDF Preview Sharepoint Online

Posted: 05 Dec 2019
by nI3o
Hey,

first a big thanks to the developers of this Programm, makes my work alot more enjoyable.

So i tried to insert a PDF preview of the curent file from the libary that im editing in my form. Enterring the code in HTML works fine.

Code: Select all

<object id="pdf_obj" data="staticurl/pdftitle.pdf"></object>'
But i need to title of the curent dokument, so i create the object via JS.

Code: Select all

var pdftitle = fd.field('FileLeafRef').value();
var pdfhtml = '<object id="pdf_obj" data="libaryurl' + pdftitle + '.pdf"></object>';

document.getElementById('pdfpreview').innerHTML = pdfhtml;
This inserts the right Code, but it seems to does so after the Page is renderd. I tried several things, but i can't seem to trigger any kind of reload of the object.

Thanks in advance.

Best wishes from Germany.

Nico

Re: PDF Preview Sharepoint Online

Posted: 06 Dec 2019
by mnikitina
Hello Nico,

Could you please clarify what is the field type of 'FileLeafRef' field?

Thank you!