Hi Wisej,
I am using IFrame in javaScript to Print the Document file.
with .htm file done.
but .pdf file not done.
Thank you.
Hi Luca (ITG),
I am using crystalReport. It allows export to Memory stream pdf.
How to do showing Memory stream pdf into IFrame javaScript?
Thank you so much.
Documents in browsers are loaded asynchronously. If you print after assigning the src the iframe is empty. You can use jsfiddle to test your javascript code. See https://www.w3schools.com/jsref/event_onload.asp
In your code you can try to change it like this:
var objFra = document.createElement('iframe'); // Create an IFrame. objFra.style.visibility = "hidden"; // Hide the frame. objFra.src = "ReadMe_001.pdf"; // Set source not done .pdf. objFra.onload = function(){ objFra.contentWindow.focus(); // Set focus. objFra.contentWindow.print(); // Print it }; document.body.appendChild(objFra); // Add the frame to the web page.
Please login first to submit.