Print iframe
JS:
1 | window.frames["printf"].focus(); |
HTML:
1 | <iframe id="printf" name="printf"></iframe> |
JS:
1 | document.getElementById("printf").contentWindow.print(); |
More: https://stackoverflow.com/questions/9616426/javascript-print-iframe-contents-only
Print div
1 | function printDiv(divName) { |
jspdf
nie nadaje się do robienia plików HTML
More: https://cdn.rawgit.com/MrRio/jsPDF/master/examples/html2pdf/showcase_supported_html.html
My implementation
1 | import replace from "lodash/replace"; |
Tests
1 | import printHtmlDocument, { REPLACE_SCRIPT } from "./printHtmlDocument"; |