PDA

View Full Version : Print dialog to print Pdf file in Ext.Window



nil5286
11 May 2012, 6:27 AM
Hi i am trying to get a "Print Dialog" to come up to print the Pdf file after the Window is loaded with pdf. Pdf gets loaded in iframe which is present in ext.window in ExtJs 4.1.


var win = Ext.create('Ext.window.Window', {
title: 'My PDF',
layout: 'fit',
items: [{
xtype: 'component',
autoEl: {
tag: 'iframe',
name: 'iframepdf',
src: '/PATIENT_SUMMARY.pdf'
}
}],
height: 300,
width: 600
});


win.show();


I tried the below code but it prints the blank page.

win.on('afterrender', function () { window.frames['iframepdf'].focus(); window.frames['iframepdf'].print(); });

I am looking out for a solution for the print dialog for Chrome /IE / Firefox.
Can anybody help me out of this. Thanks in advance.