“Impresión de JavaScript a PDF” Código de respuesta

HTML a PDF JavaScript

var doc = new jsPDF();          
var elementHandler = {
  '#ignorePDF': function (element, renderer) {
    return true;
  }
};
var source = window.document.getElementsByTagName("body")[0];
doc.fromHTML(
    source,
    15,
    15,
    {
      'width': 180,'elementHandlers': elementHandler
    });

doc.output("dataurlnewwindow");
Clumsy Chipmunk

Impresión de JavaScript a PDF

<embed
    type="application/pdf"
    src="path_to_pdf_document.pdf"
    id="pdfDocument"
    width="100%"
    height="100%" />
    
    function printDocument(documentId) {
    var doc = document.getElementById(documentId);

    //Wait until PDF is ready to print    
    if (typeof doc.print === 'undefined') {    
        setTimeout(function(){printDocument(documentId);}, 1000);
    } else {
        doc.print();
    }
}
Faster Seven

JQuery Direct Window Print PDF

<OBJECT id = "Pdf2" name="Pdf2" CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="364" HEIGHT="290">
     <PARAM NAME='SRC' VALUE="file.pdf">
</OBJECT>
<a onClick="document.Pdf2.printWithDialog()">Print file</a> 
Embarrassed Emu

Respuestas similares a “Impresión de JavaScript a PDF”

Preguntas similares a “Impresión de JavaScript a PDF”

Más respuestas relacionadas con “Impresión de JavaScript a PDF” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código