JavaScript IE浏览器展示pdf

2024-01-07 17:20:54

工具

在这里插入图片描述

语法

		<div style="height: 95%;width: 1000px;text-align: center;margin: 5px auto;">
			<div id="pdf_div" style="width: 100%;height: 100%;">
			</div>
		</div>
    var divHtml = "<object classid='clsid:CA8A9780-280D-11CF-A24D-444553540000' width='100%' height='100%' id='pdf_object' border='0'>";
	divHtml += "<param name='_Version' value='65539' />";
	divHtml += "<param name='_ExtentX' value='20108' />";
	divHtml += "<param name='_ExtentY' value='10866' />";		
	divHtml += "<param name='_StockProps' value='0' />";		
	divHtml += "<param name='SRC' value='${ctx}/file/getPdfPath.action?taskId=" + id + "&_v=" + new Date().getTime() + "'/>";		
	divHtml += "</object>";
	$('#pdf_div').html(divHtml);
	// 打印
	var obj = document.getElementById('pdf_object');
	obj.Print();

文章来源:https://blog.csdn.net/m0_37996243/article/details/135384472
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。