I use a code like below to get pdf base64 data and generate my HTML and then print it.
dataService.getPagedData("/api/fileAction/getFile", {}).then(function (data) {
viewMarkup = '<object style="width:100%;height:100%" '
+ ' type="application/pdf" '
+ ' data="data:application/pdf;base64,'
+ escape(data) + '" ></object >'
var PW = window.open('', '_blank', 'Print content');
PW.document.write(viewMarkup);
PW.document.close();
PW.focus();
PW.print();
PW.close();
}
my HTML code becomes something like this :
<object style="width:100%;height:100%" type="application/pdf"
data="data:application/pdf;base64,!!Very Long PDF Base64 Data!!">
</object >
and when I see my HTML page alone everything is ok and my pdf file is shown on the page, but when I use 'CTRL+P' on that page, or when i go through my javascript code to print the pdf, there is nothing in the print preview form of chrome!
do you know how can I solve it?