2

First off my English isn't very good but I tried my to best to explain the problem.

I have a PDF in base64, is a web application and uses JFS, that PDF is showing in a iframe with data uri in the source. This is the code:

<iframe width="100%" height="300%" id="pdf" type="application/pdf"></iframe>

$(document).ready(function(){
  $('#pdf').attr('src', 'data:application/pdf;base64,#Mbtest.pdf}');            
});

I need to print that PDF, I tried with jQuery but I have cross domain problems, but testing different ways, I opened the data uri in a new tab:

 $("#imprimirPensionado").click(function () {
   datos = $('#pdf').attr('src');
   //console.log(datos);
   prev = window.open(datos, 'large');            
 });

That code shows me the PDF in the new tab, I open the dev tools in chrome, in the js console wrote: window.print(); I can print the PDF with the dialog print.

So my question is, how I can execute window.print(); when in the new tab the PDF is full charge?

Mirza Sisic
  • 2,401
  • 4
  • 24
  • 38
Zegov
  • 21
  • 1
  • 2
  • look here : http://stackoverflow.com/questions/12092633/pdf-js-rendering-a-pdf-file-using-a-base64-file-source-instead-of-url and here : http://stackoverflow.com/questions/2820249/base64-encoding-and-decoding-in-client-side-javascript – Mih Zam May 11 '16 at 20:46
  • none of those links answer this question.... – MalachiteBR Jul 18 '17 at 13:10

0 Answers0