I am working on a mobile application. We are using jquery-mobile.
we have the ability to view or download pdf records. I have no control over the backend. I will get pdf data in json object as ajax response. I want to read this data and display it in pdf. I have the next and previous links on the page, so we need to display pdf in a div.
var data = { .... : ...., .... : ...., "pdfstream" : "KioqKioqKioqKioq......", ..... : .... }
I can read all the data, but not sure how I can read this byte stream and display it as a PDF on the page.
UPDATE: My code is working fine. But the side stream that I get from the server is erroneous.
var obj = $('<object type="application/pdf" width="100%" height="100%" border="2"></object>'); obj.attr('data','data:application/pdf;base64,'+bytestream); $('#divContainer').append(obj);
its working tone in all browsers is expected in IE. You need to check why it does not work in IE.
source share