Questions tagged [pdfmake]

Client/server side PDF printing in pure JavaScript

Client/server side PDF printing in pure JavaScript

In-browser

Print PDFs directly in the browser or delegate it to your NodeJS backend. Use the same document definition in both cases.

Fully declarative

Forget about manual x, y calculations. Declare document structure and let pdfmake do the rest.

Powerful layout engine

Use paragraphs, columns, lists, tables, canvas, etc... Declare your own styles, use custom fonts, build a DSL and extend the framework.

Features

  • line-wrapping,
  • text-alignments (left, right, centered, justified),
  • numbered and bulleted lists,
  • tables and columns
    • auto/fixed/star-sized widths,
    • col-spans and row-spans,
    • headers automatically repeated in case of a page-break,
  • images and vector graphics,
  • convenient styling and style inheritance,
  • page headers and footers:
    • static or dynamic content,
    • access to current page number and page count,
  • background-layer
  • page dimensions and orientations,
  • margins,
  • custom page breaks,
  • font embedding,
  • support for complex, multi-level (nested) structures,
  • helper methods for opening/printing/downloading the generated PDF.

References

560 questions
6
votes
4 answers

File 'Roboto-Regular.ttf' not found in virtual file system in Angular 6 (pdfMake)

I`m getting ERROR Error: File 'Roboto-Regular.ttf' not found in virtual file system when trying using pdfMake in angular 6. I did declare module 'pdfmake/build/pdfmake.js'; declare module 'pdfmake/build/vfs_fonts.js';` in typings.d.ts and also…
rankery
  • 307
  • 1
  • 5
  • 14
6
votes
5 answers

pdfMake - open() and print() functions are not working

I'm trying to learn how to use pdfMake. I'm trying to use open and print to generate or print the information respectively. But, when I click on the button which fires the event, a new tab opens for a second and vanishes. The page which opens is…
Ritik Saxena
  • 694
  • 1
  • 11
  • 23
6
votes
4 answers

put checkmark in pdfmake report

i have a project to print out the working report. i got trouble when putting check mark inside pdfmake generated report i follow some instructions from below link…
Jsnow
  • 375
  • 1
  • 6
  • 14
6
votes
1 answer

How to stretch the table height in pdfmake?

Is there any option in pdfmake to fill the table in entire page ? Demo https://jsfiddle.net/t2dbcb4t/ var docDefinition = { pageMargins: [0, 0, 30, 0], content: [{ table: { widths: ['20%', '80%'], body: [ [{ …
Mo.
  • 26,306
  • 36
  • 159
  • 225
6
votes
4 answers

How to use pdf output of PDFMake in the attachment mail options of NodeMailer?

Here is a one of PDFMake's code snippet to create pdf file: var pdfDoc = printer.createPdfKitDocument(docDefinition); pdfDoc.pipe(fs.createWriteStream('pdfs/absolute.pdf')); pdfDoc.end(); and here is one of the attachment option in NodeMailer: { …
Ritesh Jagga
  • 1,387
  • 1
  • 11
  • 23
5
votes
4 answers

How to create a table footer in pdfmake

Is there a way to create a table footer in pdfMake? I have a big table that only fits on multiple pages. I want to repeat the table footer on each page.
Sebastián
  • 117
  • 1
  • 12
5
votes
1 answer

Border-Radius for PDFMake

I'm wondering if anyone knows a hack or a way around setting a border-radius in PDFMake. I have an image which I plan to have to a border-radius of about 4px. { image: 'sampleImage.jpg', width: 150, height: 150, }, There's no…
Elaine Byene
  • 3,868
  • 12
  • 50
  • 96
5
votes
1 answer

Align one column with pdfmake and datatables

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…
K4neda
  • 131
  • 1
  • 9
5
votes
2 answers

Any way to reduce the bundle size of pdfmake

I am using pdfmake in my angular 4 app and it really helps me in making nice pdf docs on the client side. But I am a little concerned when I look into the bundle-report after an aot build. It adds a considerable amount of weight to my chunk. Is…
Anoop Kc
  • 147
  • 1
  • 9
5
votes
1 answer

How can use pdfmake in ionic 2?

I'm trying to create pdf in ionic2 with pdfmake. I added the library to my app: $ npm install pdfmake --save Import it into class import { Component } from '@angular/core'; import { NavController, NavParams, LoadingController, ToastController,…
calraiden
  • 1,686
  • 1
  • 27
  • 37
5
votes
1 answer

pdfmake get wrong page position sizes

I am using it on the client side and my pdf file will contain only images. No matter how many i am adding, first image got opposite width with height. While from second and farther everything looks ok. And config that i am using is: var content =…
Honchar Denys
  • 1,408
  • 4
  • 29
  • 54
5
votes
3 answers

Can a subgrid be exported in angular ui-grid

I'm using the grid from http://ui-grid.info/ in a project. I've created a hierarchical grid, which works nicely, but when I do an export, it only exports the data from the top-level grid. This is by design and is standard functionality for the…
Matt Eno
  • 687
  • 5
  • 25
5
votes
2 answers

DataTables & PDFmake

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…
Darshan
  • 53
  • 1
  • 3
  • 10
5
votes
4 answers

Watermark using pdfmake

In Javascript, I am using pdfmake to generate a pdf document. I read it from github that it supports watermark and the following is my usage but it is giving me some random and weird characters. Those characters are the same no matter what texts are…
david park
  • 139
  • 2
  • 11
5
votes
1 answer

Export html to PDF with JavaScript

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
, with jsPDF the styling is very limited, I saw this question but…
István
  • 5,057
  • 10
  • 38
  • 67
1 2
3
37 38