b30-1896797.zul

来自「ZK是一个Ajax Java Web框架」· ZUL 代码 · 共 39 行

ZUL
39
字号
<?xml version="1.0" encoding="UTF-8"?>

<!--
B30-1896797.zul

{{IS_NOTE
	Purpose:
		
	Description:
		
	History:
		Thu Mar 13 11:24:31 TST 2008, Created by jumperchen
}}IS_NOTE

Copyright (C) 2008 Potix Corporation. All Rights Reserved.

{{IS_RIGHT
}}IS_RIGHT
-->
<zk xmlns:n="http://www.zkoss.org/2005/zk/native">
	<n:p>It is correct, if you can see the pdf file.
	Also, try to click the invalidate button to see if it is still OK.</n:p>
	<window id="w2" title="Test PDF" closable="true" mode="overlapped" width="800px">
		The content of iframe is created by AMedia(InputStream)  
		<button label="invalidate" onClick="ifr.invalidate();"/>
		<iframe id="ifr" width="80%" height="500px">
			<zscript>
				import javax.servlet.ServletContext;
				import org.zkoss.web.fn.*;
				ServletContext context = ServletFns.getCurrentServletContext();
				java.io.FileInputStream fis = new java.io.FileInputStream(context.getRealPath("/test2") + "/B1896797.pdf");
				org.zkoss.util.media.AMedia media = new org.zkoss.util.media.AMedia("B1896797.pdf",null,null,fis);
				ifr.setContent(media);
			</zscript>
		</iframe>

	</window>
</zk>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?