如何在ext.window中显示pdf文件?

时间:2013-08-22 11:35:52

标签: pdf extjs

它不起作用,出了什么问题?

var win = new Ext.Window({
    title: 'PDF Content',
    width: 400,
    height: 600,
    maximizable: true,
    layout: 'fit',
    plain: true,

    items: { // Let's put an empty grid in just to illustrate fit layout
        xtype: 'component',
        autoEl: {
            tag: "iframe",
            src: "../../../resources/august2013.pdf"
        }
    }
    //items : [ {
    //    html: '<object width="100%" height="100%" data="../../../resources/august2013.pdf"></object>'
    //} ]
})
win.show();

Deamon下面插入代码后我得到的这个视图!

enter image description here

1 个答案:

答案 0 :(得分:6)

试试这个:

var win = Ext.create('Ext.window.Window' {
    title: 'PDF Content',
    width: 400,
    height: 600,
    modal: true,
    closeAction: 'hide',
    items: [{
        xtype: 'component',
        html: '<iframe src="../../../resources/august2013.pdf" width="100%" height="100%"></iframe>',
    }]
});
win.show();