JS print PDF files

<body>
<div id = 'printDiv'>
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" id="pdfId" width="600" height="600">

</object>
</div>
<input type="button" value="print" onclick="printPdf();"/>
</body>
<script>
function printPdf(){

pdfId.LoadFile('D:\\Users\\ex-huangming003\\Desktop\\bcxy2.pdf');

pdfId.setPageMode("none");

pdfId.setLayoutMode("DontCare");

pdfId.printAllFit(false);

}
</script>

I used the plug-in printed PDF file adobe, file, but not finished loading began to print, asynchronous loading, prawns you have had no way to make synchronous loading, loading in print

Started by Lance at December 07, 2016 - 2:25 PM

The core code

pdfId.LoadFile('PDF file path');

pdfId.setPageMode("none");

pdfId.setLayoutMode("DontCare");

pdfId.printAllFit(false);

Posted by Lance at December 12, 2016 - 3:12 PM

Don't use this plugin
But estimates should have some similar functions such as onload.
The landlord can go to have a look

Posted by Silvester at December 19, 2016 - 4:08 PM