pdfmake

pdfMake - cannot open file

六月ゝ 毕业季﹏ 提交于 2019-12-11 07:00:22
问题 I used this module on Nodejs : https://github.com/bpampuch/pdfmake Here is my code to create it : const fonts = { Roboto: { normal: './fonts/Roboto-Regular.ttf', bold: './fonts/Roboto-Medium.ttf', italics: './fonts/Roboto-Italic.ttf', bolditalics: './fonts/Roboto-Italic.ttf' } }; let PdfPrinter = require('pdfmake/src/printer'); let printer = new PdfPrinter(fonts); let fs = require('fs'); module.exports.generateFile = function (data,callback) { let fileName = "Logins_" + data[0]["userLogin"] +

How to fill column background color for pdfmake with fillColor?

情到浓时终转凉″ 提交于 2019-12-10 15:59:50
问题 Is there any option to fill column background color with fillColor: '#dedede' ? fillColor works in tablecell very well at the same time it doesn't work for column :( <script src="https://rawgit.com/bpampuch/pdfmake/master/build/vfs_fonts.js"></script> <script src="https://rawgit.com/yelouafi/pdfmake/master/build/pdfmake.js"></script> <script> function print(argument) { // open the PDF in a new window pdfMake.createPdf(docDefinition).open(); } </script> <button onclick="print()" style="display

Align one column with pdfmake and datatables

与世无争的帅哥 提交于 2019-12-10 15:14:55
问题 Trying to align 1 column to the left with the other columns centered in PDFMAKE using a dynamically generated mysql table and datatables, the code i have works if you disable pagination, but with pagination it only justify's the first 25 rows that are displayed on the screen, any ideas? $(document).ready(function() { $("#loops").DataTable( { dom: "<'row'<'col-sm-3'l><'col-sm-6 text-center'B><'col-sm-3'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", buttons: [ { extend:

Add border arround a paragraph with pdfmake

心不动则不痛 提交于 2019-12-10 10:12:25
问题 I'm generating pdf via pdfmake. Let's say i have content of the pdf like this var docDefinition = { content: [ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam a pharetra odio.', 'Vestibulum erat mauris, sodales et consequat sit amet, ultricies vitae erat. Etiam feugiat orci justo, ultrices malesuada dui ornare ac.', ] }; Is it possible to add border arround one of the paragraphs or do I have to use tables for this? 回答1: I have not gotten apply borders to a paragraph. I think

How to use external library on angular-cli? (pdfmake)

允我心安 提交于 2019-12-09 22:06:03
问题 Ok, so, im using angular-cli for my test project and since im new to web development world im trying new thinks. This time I couldn't make it work. Well, what I tried? well I kind followed pdfmake readme and into my index.html I placed this two lines inside body tag: <script src='build/pdfmake.min.js'></script> <script src='build/vfs_fonts.js'></script> well, Im getting this error: GET http://localhost:4200/build/pdfmake.min.js GET http://localhost:4200/build/vfs_fonts.js 404 (Not Found) So,

Add new page while generating pdf from html with dynamic content

◇◆丶佛笑我妖孽 提交于 2019-12-08 12:00:18
问题 I'm trying to generate pdf from html with dynamic content using pdfmake . its working good but having an issue. Html content is to large and pdf only generating one page and rest of the content from html is cut. How can I add other page to pdf if content is more than one page. Here is my code. createPdf(): void { var main = $('.main'); html2canvas(this.el.nativeElement, { onrendered: function (canvas) { var data = canvas.toDataURL(); var a4 =[ 595.28, 841.89]; var docDefinition = { pageSize:

Image not showing when generating pdf in angularjs using pdfmake

核能气质少年 提交于 2019-12-07 12:50:25
问题 I'm using pdfmake, a nice pdf printing library in javascript to generate pdf in my angularjs SPA. Everything is working fine when I'm using only texts. The pdf is showing correctly with all texts in place. But it isn't working for me when I'm trying to show images. No error, no empty pdf, just nothing happens. There's no 404 either. Here's the code I'm trying right now, var dd = { content: [ { image: 'picture13438908025659.jpg' }, { text: 'Patient\'s Detail', fontSize: 18, bold: true }, {

Use Glyphicons or Font-Awesome in pdfmake prints

感情迁移 提交于 2019-12-06 06:07:18
I am developing a webapp using pdfmake for the printing. In more recent days I started using Glyphicons and Font-Awesome-Icons in my project, now I need those in the printout as well. But I can't really imagine what would be the best way to achieve this. I see two possibilities: Include the respective Font in pdfmake and create something like a map which determines the Icons font-representation by it's class name (because this is what is used in the app). In this case I could still use the font colors for the Icons I could use something like phantomJS to generate Images of the Icons, but I don

Angular UI Grid - Exporting an image to a pdf

我的梦境 提交于 2019-12-06 04:25:07
I want to add an image to the header of the pdf. I am trying to add the image, which I converted to base 64, to exporterPdfHeader. $scope.gmGrid.exporterPdfHeader = { margin: [30, 5, 30, 15], table: { widths: [ '*', '*' ], body: [ [ 'MC #: ' + $scope.mc, 'Week Ending Date: ' + $scope.weekEndDate ], ], //ADD IMAGE myImage: 'data:image/false;base64,iVBORw0KGgoAAAANSUhEUgAAAIgAAAAkCAYAAABSZHLHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8

Add border arround a paragraph with pdfmake

笑着哭i 提交于 2019-12-06 03:50:53
I'm generating pdf via pdfmake . Let's say i have content of the pdf like this var docDefinition = { content: [ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam a pharetra odio.', 'Vestibulum erat mauris, sodales et consequat sit amet, ultricies vitae erat. Etiam feugiat orci justo, ultrices malesuada dui ornare ac.', ] }; Is it possible to add border arround one of the paragraphs or do I have to use tables for this? I have not gotten apply borders to a paragraph. I think the only option you have is to use tables. Below this lines I have attached a simple code that you can