Convert response data from HTML to PDF

0

My response.data is returned a ticket 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)
    })
}
    
asked by anonymous 09.08.2017 / 21:39

1 answer

1

I recommend the library PDFKit , it does the "conversion" from HTML to PDF, I have already used it and it is very good

    
28.08.2017 / 19:28