Intente agregar iframe src para un iframe usando la URL de pdf en línea.
Pero, ¿es posible verificar si el pdf en línea se desplaza hacia abajo y llega al final (no HTML)? Porque si trato de imprimir contentDocument, se devuelve nulo
HTML
<iframe id="myFrame" name="myFrame" class="scroll-y overlay" style="height:300px;"></iframe> <label style="cursor:pointer;"> <input type="checkbox" id="chkTermAndCondition" disabled onchange="handleChange(this);" /> Approve S and K. </label>JS
$("#myFrame").attr("src","https://upload.wikimedia.org/wikipedia/commons/4/40/GeneralBiology.pdf"); $("#myFrame").load(function () { //console.log("myFrame load function"); var win_iframe = document.getElementById('myFrame').contentWindow; var doc_iframe = document.getElementById('myFrame').contentDocument; $(win_iframe).on("scroll", function() { if ((win_iframe.innerHeight + win_iframe.scrollY) >= doc_iframe.body.offsetHeight) { //console.log("aaa..! works perfectly!"); $("#chkTermAndCondition").removeAttr("disabled"); } }); });