Categorias
iiiiii
imprimir con javascript
Descripcion
imprimir un pdf en un iframe con javascript
javascript
window.onload = function() {
function imprimirpdf(url){
var id = "iframe", frame = document.createElement("iframe");
frame.setAttribute("id", id);
frame.setAttribute("width", "800px");
frame.setAttribute("height", "600px");
frame.setAttribute("allowfullscreen", "true");
frame.setAttribute("name", "printframe");
document.body.appendChild(frame);
frame.onload = function() {
this.requestFullScreen = this.mozRequestFullScreen || this.webkitRequestFullScreen;
this.requestFullScreen();
setTimeout(function() {
print();
},2000) };
//se le agrega el contenido al iframe
frame.setAttribute("src", url);
}
imprimirpdf("mipdf.pdf"); // ruta del pdf
}