27 February 2023

How to preview doc or docx file in html/iFrame?

Preview doc or docx file in html/iFrame

var link = "paste docx file link here";
var iFrameUrl = 'https://view.officeapps.live.com/op/embed.aspx?src=' + link + '&embedded=true';

$('#documentModalIframe').attr('src',iFrameUrl);

or

<iframe src="https://docs.google.com/gview?url=http://remote.url.tld/path/to/document.doc&embedded=true"></iframe>

No comments:

Post a Comment

How to add re-captcha v3 on all Elementor forms using coding?

 Add re-captcha v3 on all Elementor forms using coding add_action('wp_footer',function(){     ?> <script src="https://www...