crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

print html with my data in another page #621

Open churongcon opened 2 years ago

churongcon commented 2 years ago

My data: /hello.html <p> hello </p> and print page /print.html

window.printPdfBase64 = function () {
            fetch('hello.html').then(function (response) {
                response.text().then(function (mydata) {
                    printJS({
                        printable: mydata,
                        type: 'html'
                    })
                })
            })
        }

But it dont work help me :(