Convert Response date from HTML to PDF

Asked

Viewed 154 times

0

My response.data is returned a billet in HTML format, I want to convert it to PDF. How do I?

Below a part of the code:

imprimirboleto: function () {
    axios({
        method: 'get',
        url: '/server/boleto',
        params: {
            banco : this.banco,
            valor : this.valor,
        }
    }).then(function (response)
    {
        var myWindow = window.open("", "MsgWindow", "width=800,height=600, resizable, scrollbars,status")
        myWindow.document.write(response.data) // aqui quero abrir em pdf

    }).catch(function (error) {
        console.log(error)
    })
}
  • 1

    Maybe https://www.npmjs.com/package/vue-pdf can help.

1 answer

1


I recommend the library Pdfkit, it makes the "conversion" from HTML to PDF, already used and is very good

Browser other questions tagged

You are not signed in. Login or sign up in order to post.