pdfmake

Embedding a background image in pdfmake

江枫思渺然 提交于 2019-12-05 16:43:08
I'm using pdfmake http://bpampuch.github.io/pdfmake/index.html#/gettingstarted to implement html to pdf conversion. To create a PDF, I'm using some hard-coded text and some text pulled in with AngularJS from a .json file. All works well for the exception of the background image. Has anyone done this before? Used a background image with pdfmake? I would like to get some advice on how to force it to grab it and actually put it in the background. Thanks. Turns out that in order to set an image as the background, one needs to decide on the .pdf output size, size the bkg image appropriately and

DataTables & PDFmake

自闭症网瘾萝莉.ら 提交于 2019-12-05 09:35:24
I'm trying to work with DataTables Export feature, where I am able to export as CSV, xlxs, pdf. Now my current requirement is to export a custom pdf (change the font size, color, etc.). In the DataTable documentation it states, that we can integrate it with PDFmake, which I am unable to do so. If anyone could please help in a way to integrate/use PDFmake with DataTables it would be really helpful. Thanks in advance. I'm initialising the DataTables var table = $('#Table').DataTable( { lengthChange: true, buttons: [ 'copyHtml5', { extend: 'csvHtml5', title: 'FileName' }, { extend: 'excelHtml5',

Export html to PDF with JavaScript

守給你的承諾、 提交于 2019-12-05 03:06:29
问题 I want to export HTML to PDF with JavaScript, I saw libraries like jsPDF and pdfMake, but they are very limited. For example, with none of them I can export HTML elements, like <hr> , with jsPDF the styling is very limited, I saw this question but the answer is not working for me, with pdfMake I cannot download the pdf, just with chrome. 回答1: If you can retrieve the HTML from an URL you may want to check this answer that I wrote that explains how to do it. Example: https://dhtml2pdf.herokuapp

Generating PDF file with Ionic framework

倾然丶 夕夏残阳落幕 提交于 2019-12-04 10:00:06
Is there any plugin for Ionic framework to generate a pdf file using html content? Basically I need to create a html with values passed from an Ionic mobile application and some css styles, and then convert it into a pdf file which can be saved inside the local file system in a device (Android device and iOS device). I want to do this with a javascript like library so that it can be used in both Android and iOS devices. Alright, this is a more detailed answer that provides the example I mentioned in my first answer. I have a repo on github: https://github.com/jeffleus/ionic-pdf and an online

pdfmake API? Is there a list of styles, fonts, capabilities?

半腔热情 提交于 2019-12-04 09:15:56
问题 I'm using pdfmake. I want to format a document and they have good examples on github and in their playground but I was wondering if they featured all capabilities therein. I get the feeling that their may be additional properties like switching fonts, adding different style elements or underlining - things not expressly shared in the examples. Maybe what you see is what you get and that is all but I went over the github page pretty throughly and did not find a more detailed list of

Building table dynamically with PDFMake

Deadly 提交于 2019-12-03 03:10:36
I'm working with pdfmake to generate pdf with javascript. I'm trying to build a table dynamically but not works ,this my attempt $.ajax({ type: "POST", url: myURL, success:function(data){ /* data has a format like : *[{"peaje":"Peaje 1","ruta":"Ruta 1","fechaCruce":"2014-10-18","hora":"15:42","valor":"5000"},{"peaje":"Peaje 1","ruta":"Ruta 1","fechaCruce":"2014-10-18","hora":"14:21","valor":"7000"},{"peaje":"Peaje 1","ruta":"Ruta 1","fechaCruce":"2014-09-19","hora":"11:58","valor":"17000"}] */ var peajes = JSON.parse( data ); var body = []; var titulos = new Array( 'PEAJE', 'RUTA', 'FECHA

pdfmake API? Is there a list of styles, fonts, capabilities?

て烟熏妆下的殇ゞ 提交于 2019-12-03 02:43:51
I'm using pdfmake. I want to format a document and they have good examples on github and in their playground but I was wondering if they featured all capabilities therein. I get the feeling that their may be additional properties like switching fonts, adding different style elements or underlining - things not expressly shared in the examples. Maybe what you see is what you get and that is all but I went over the github page pretty throughly and did not find a more detailed list of capabilities. It seems hella similar to html but it doesn't seem to have the same styling capabilities of html

Dotted line in pdf file with IE 10

半城伤御伤魂 提交于 2019-12-02 22:07:54
问题 The graph is the same and correct on browser, Chorme, IE11, IE10, etc.... In IE 11, I press a button to create png file, the result is correct. In IE 10, I press a button to create png file, the result is incorrect, the dotted line of graph change to solid line. I have no idea about this problem, can anyone help me? IE 11: (source: 2.pik.vn) IE 10: (source: 2.pik.vn) This is the code i use to convert from svg to canvas: var svg = document.getElementById("graphP").innerHTML; var canvas =

Dotted line in pdf file with IE 10

谁说我不能喝 提交于 2019-12-02 09:47:07
The graph is the same and correct on browser, Chorme, IE11, IE10, etc.... In IE 11, I press a button to create png file, the result is correct. In IE 10, I press a button to create png file, the result is incorrect, the dotted line of graph change to solid line. I have no idea about this problem, can anyone help me? IE 11: (source: 2.pik.vn ) IE 10: (source: 2.pik.vn ) This is the code i use to convert from svg to canvas: var svg = document.getElementById("graphP").innerHTML; var canvas = document.getElementById("canvas"); canvg(canvas, svg); var imgDataP = canvas.toDataURL(); 来源: https:/

Save this pdf in the cache/local storage on ionic

試著忘記壹切 提交于 2019-12-01 14:10:56
Ho to everyone. I followed this tutorial to create a modal view with a pdf generated with pdfmake. http://gonehybrid.com/how-to-create-and-display-a-pdf-file-in-your-ionic-app/ My simply question is how can i save the pdf in my local storage on in cache? I need that to send the pdf by email or open it with openfile2. I'm using Ionic and cordova. I don't know how you code it, but I know what plugin you should use: https://github.com/apache/cordova-plugin-file The git contains a complete documentation of the plugin so everything you could need should be there. Sample code to write pdf file in