现在的位置: 首页 > 综合 > 正文

ExtJS4 Panel中嵌套PDF

2012年02月12日 ⁄ 综合 ⁄ 共 661字 ⁄ 字号 评论关闭

原文地址:http://ext4all.com/post/extjs-4-show-pdf-in-a-panel

注意:前提是你的浏览器需要安装上PDF的插件。!例如:Adobe Reader

效果图:

 

<script type="text/javascript">
        Ext.onReady(function () {
            Ext.widget('panel', {
                title: 'My Pdf Panel一步一步学习asp.net MVC',
                width: 600,
                height: 400,
                items: {
                    xtype: 'component',
                    autoEl: {
                        tag:'iframe',
                        style:'height:100%;width:100%;border:none',
                        src:'2.pdf'
                    }
                },
                renderTo:Ext.getBody()
            });
        });
    </script>

 

 ExtJS 3中 Panel嵌套PDF的方法如下:

参考原文:http://ext4all.com/post/extjs-3-show-pdf-in-a-panel

Ext.onReady(function () {
    Ext.create({
        title: 'My PDF',
        xtype: 'panel',
        width: 600,
        height: 400,
        items: {
            xtype: 'box',
            autoEl: {
                tag: 'iframe',
                style: 'height: 100%; width: 100%',
                src: '/files/pdf-sample.pdf'
            }
        },
        renderTo: 'output'
    });
});

 

 

 

 

抱歉!评论已关闭.