pdfmake

Save this pdf in the cache/local storage on ionic

故事扮演 提交于 2019-12-01 12:40:22
问题 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. 回答1: 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

pdfmake: How to create multiple page pdf with different orientation?

这一生的挚爱 提交于 2019-12-01 04:18:05
is there a way to create multiple page pdf with different page orientation using pdfmake ? to make it simple, I want something like this : Page 1 with portrait orientation page 2 with landscape orientation page 3 with portrait orientation I've tried it so many times with different method but it always effect to all page. sorry for my terible english RandomUser This is and old question, but answering may help others. If you want to change page orientation you only need specify the new value at the first node of the page. Below this lines I have attached a simple code that you can paste directly

Angular2: How to use pdfmake library

跟風遠走 提交于 2019-11-30 06:55:57
Trying to use client-side pdf library pdfmake in my Angular 2 (version=4.2.x) project. In .angular-cli.json file, I declared js like this: "scripts": [ "../node_modules/pdfmake/build/pdfmake.js", "../node_modules/pdfmake/build/vfs_fonts.js" ] And then in app.component.ts, I used it like this: import * as pdfMake from 'pdfmake'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent implements OnInit { pdf: any; downloadPdf() { let item = {firstName: 'Peter', lastName: 'Parker'}; this.pdf = pdfMake; this.pdf

pdfmake: How to create multiple page pdf with different orientation?

只谈情不闲聊 提交于 2019-11-30 04:22:10
问题 is there a way to create multiple page pdf with different page orientation using pdfmake? to make it simple, I want something like this : Page 1 with portrait orientation page 2 with landscape orientation page 3 with portrait orientation I've tried it so many times with different method but it always effect to all page. sorry for my terible english 回答1: This is and old question, but answering may help others. If you want to change page orientation you only need specify the new value at the

PDFmake - html table to pdfmake table?

£可爱£侵袭症+ 提交于 2019-11-29 08:37:56
I am trying to make an application, which contains html tables. I want a download button, and onClick event, downloads a PDF file containing all the html tables in it. Can it be done? Can someone help me with a function that converts the html table into an object so that it can be pushed into a PDF file through pdfmake? I found a working solution over here: https://github.com/bpampuch/pdfmake/issues/205 function ParseContainer(cnt, e, p, styles) { var elements = []; var children = e.childNodes; if (children.length != 0) { for (var i = 0; i < children.length; i++) p = ParseElement(elements,

Angular2: How to use pdfmake library

让人想犯罪 __ 提交于 2019-11-29 08:11:05
问题 Trying to use client-side pdf library pdfmake in my Angular 2 (version=4.2.x) project. In .angular-cli.json file, I declared js like this: "scripts": [ "../node_modules/pdfmake/build/pdfmake.js", "../node_modules/pdfmake/build/vfs_fonts.js" ] And then in app.component.ts, I used it like this: import * as pdfMake from 'pdfmake'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent implements OnInit { pdf: any;

How to apply web worker to rendering of a PDF using makepdf

若如初见. 提交于 2019-11-29 05:16:50
I successfully created a PDF using a JavaScript plug-in ( pdfmake ) and it was great. But when I try to render an ~8,000-row inventory/ledger printout, it freeze for over a minute. This is how I usually declare my docDefinition var docDefinition = { pageOrientation: orientation, footer: function(currentPage, pageCount) { return {text: currentPage.toString() + ' / ' + pageCount, fontSize:8, alignment:'center'}; }, content:[ printHeader, { fontSize: 8, alignment: 'right', style: 'tableExample', table: { widths: width, headerRows: 1, body: arr }, layout: 'lightHorizontalLines' }] } where var

PDFmake - html table to pdfmake table?

无人久伴 提交于 2019-11-28 02:02:13
问题 I am trying to make an application, which contains html tables. I want a download button, and onClick event, downloads a PDF file containing all the html tables in it. Can it be done? Can someone help me with a function that converts the html table into an object so that it can be pushed into a PDF file through pdfmake? 回答1: I found a working solution over here: https://github.com/bpampuch/pdfmake/issues/205 function ParseContainer(cnt, e, p, styles) { var elements = []; var children = e

How to apply web worker to rendering of a PDF using makepdf

為{幸葍}努か 提交于 2019-11-27 18:59:32
问题 I successfully created a PDF using a JavaScript plug-in (pdfmake) and it was great. But when I try to render an ~8,000-row inventory/ledger printout, it freeze for over a minute. This is how I usually declare my docDefinition var docDefinition = { pageOrientation: orientation, footer: function(currentPage, pageCount) { return {text: currentPage.toString() + ' / ' + pageCount, fontSize:8, alignment:'center'}; }, content:[ printHeader, { fontSize: 8, alignment: 'right', style: 'tableExample',

Generate PDF from HTML using pdfMake in Angularjs

…衆ロ難τιáo~ 提交于 2019-11-26 01:57:48
问题 I am trying to create a PDF from my HTML using pdfMake and Angular (I\'ve also tried jsPDF and couldn\'t get it to work either). I tried using the following code in my Angular controller: var blob = new Blob([document.getElementById(\'exportable\').innerHTML]) var docDefinition = { content: [blob] } pdfMake.createPdf(docDefinition).open(); but I receive the following error: Unrecognized document structure: {\"_margin\":null}\". My HTML consists of two simple tables in a div exportable . If