1
자바 스크립트로 Google 문서 뷰어가 제공하는 iframe에서 열리는 PDF를 인쇄 할 수 있습니까? ...자바 스크립트로 Google 문서 뷰어로 작성된 iframe에서 PDF 파일을 인쇄
<button style="height:35px; cursor:pointer; " class="button" id="print"> <img src="images/print.png"/> <span style=" vertical-align: super; "> Print this note </span> </button>
<?php echo '<iframe id="PDFtoPrint" src="http://docs.google.com/gview?url='.JURI::root().'resources/pdf_full/'.$full_name.'&embedded=true" style="width:800px; height:1000px; " frameborder="0"></iframe>';?>
여기 인쇄에서 jQuery 코드입니다 : 내가 사용자가 동일한 페이지에하고 같은 페이지에서 PDF를 인쇄 할 몇 가지 이유 ... 여기
은 iframe 대응의 코드는jQuery(document).ready(function($) {
$('#print').click(function(){
// window.frames["PDFtoPrint"].focus();
// window.frames["PDFtoPrint"].print(); // NOT WORKING
// var PDF = document.getElementById('PDFtoPrint');
// PDF.focus();
// PDF.contentWindow.print(); // NOT WORKING
// $("#PDFtoPrint").get(0).contentWindow.print(); // NOT WORKING
// document.getElementById("PDFtoPrint").contentWindow.print(); // NOT WORKING
});
});