I am in a problem and I turn to you to see possible solutions.
I work in an application with Ionic (v1) and inside the app I have an HTML prototype template, from one of the flows the data that we show in the pdf comes out. I get the html code of the template so
$http.get('app/modules/Test/views/comprobante.html', {
cache: $templateCache
})
.then(function(result) {
console.log(result.data);
});
The value of result.data
is the pure HTML code and to replace the values I use keywords and replace them with the typical replace
This works very well, we also use a plugin pdf-generator
for all that HTML text we get a pdf file in base64 and that we upload it to the server.
Now, we also requested the web version of the application ( browser
) and as you know, cordova plugins that do not have support for this platform simply do not work, so this process that explains does not work. Try to implement the library jsPDF
but does not meet what I need, that html text that I get does not generate a correct PDF, rather empty and I imagine that it is because it does not interpret the html code as such.
Will there be any way to do this process from javascript? Get from a HTML file a pdf in base64 and then upload it to the server?
I remain attentive to any questions.