First of all, two things:
- I know, there a lot of similar questions, but none of them helped me finding a solution for my problem
- I'm a beginner - in every single aspect of programming...
Problem: Receiving a byte array from a webservice, I need to show a PDF in Internet Explorer 9. Following code is working in Chrome, but in IE9, all I receive is a dark gray panel, where the PDF is ment to be.
Ext.define('Ext.ux.form.DocumentFrame', {
extend: 'Ext.container.Container',
alias: 'widget.documentframe',
layout: 'hbox',
initComponent: function () {
var me = this;
var binaryData = me.value.DocumentData;
var source = 'data:application/pdf;base64,' + (binaryData);
Ext.applyIf(me, {
items: [
{
xtype: 'box',
itemId: 'panel-document-frame',
width: 600,
height: 600,
autoEl: {
tag: 'object',
width: '100%',
height: '100%',
type: 'application/pdf',
data: source
}
}
]
});
me.callParent(arguments);
}
});
- Is there a problem with the MIME-Type?
- Do I have to encode or decode the byte array?
I just don't understand why this works in other browsers, but not in IE9, especially while giving a path to a stored PDF-File is working without any problems (even in IE9). I do this by setting the data-parameter for autoEl like this:
data: 'content/files/Designer.pdf'
Note: by doing this in IE9, a MessageBox appears: "An Active X Control on this Page Might be Unsafe to Interact with Other Parts of this Page". At the very moment, i do not care about this.
Am I so wrong on trying to show a PDF from a byte array? I'm really stuck on this and any help would be highly appreciated!
Thank you in advance!