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
59
votes
5 answers

Generate PDF from HTML using pdfMake in Angularjs

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…
Rani Radcliff
  • 4,856
  • 5
  • 33
  • 60
23
votes
6 answers

PDFMAKE: 'Roboto-Regular.ttf' not found in virtual file system ONLY AFTER GULP

I created a simple app using knockout/bootstrap/gulp that downloads a pdf using pdfMake.js. It works fine in debug mode using VS2017. After publishing and using gulp it gives this error when run: File 'Roboto-Regular.ttf' not found in virtual file…
esmc
  • 231
  • 1
  • 2
  • 6
20
votes
2 answers

Increase header size pdfMake

I am trying to increase the header size on a pdf using pdfmake. Currently am able to get a header on both the left and right of the page, which is what I want, but when the height passes 26, the image disappears because there is a limited amount…
sqrepants
  • 996
  • 2
  • 10
  • 22
16
votes
3 answers

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

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…
rashadb
  • 2,515
  • 4
  • 32
  • 57
15
votes
3 answers

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

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…
Ismail Sunny
  • 151
  • 1
  • 1
  • 3
14
votes
1 answer

Type Error Cannot set property '_minWidth' of undefined - pdfmake, Angular 2

I am trying to add widths to my table but for some reason I get below error: Component.html:187 ERROR TypeError: Cannot set property '_minWidth' of undefined at DocMeasure.measureTable (pdfmake.js:4487) at pdfmake.js:4012 at StyleContextStack.auto…
Murlidhar Fichadia
  • 2,589
  • 6
  • 43
  • 93
14
votes
3 answers

Invalid image error using dataUrl in pdfmake

I'm using pdfmake to generate a PDF doc in an angular app, and just trying to add an image to the output using a dataURL (following the pdfmake docs. var docDefinition = { content: [ { table: { …
wonder95
  • 3,825
  • 8
  • 45
  • 74
13
votes
4 answers

Angular2: How to use pdfmake library

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" …
Softhinker.com
  • 895
  • 2
  • 11
  • 25
13
votes
3 answers

Building table dynamically with PDFMake

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 : …
Cristian
  • 1,480
  • 5
  • 32
  • 65
12
votes
1 answer

pdfMake table header not repeated on page break

Can I force somehow the table header repeating on each page in pdfMake, when I have a big table, that only fits on multiple pages.
István
  • 5,057
  • 10
  • 38
  • 67
11
votes
3 answers

How to use enum from typescript definition file?

I'm programming in nodejs using typescript. I'm using pdfmake and I installed typescript definition files for this library (@types/pdfmake) https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pdfmake/index.d.ts I'm importing one of…
11
votes
4 answers

Dynamic check if text Goes to next page and add pagebreak in pdf using pdfmake

For a project im making offer and invoice pdf's on the fly using pdfmake in javascript. The problem im facing is having text blocks going off the page in the middle. What i want is to check if a certain block of text or a table is going to be split…
André Kool
  • 4,880
  • 12
  • 34
  • 44
11
votes
4 answers

Lines, circles and other shapes?

Is it possible to draw lines, circles and other shapes with pdfmake? If yes, is there a documentation or are there any samples? I would like to replace jsPDF with pdfmake.
DoK
  • 851
  • 3
  • 15
  • 31
11
votes
3 answers

Embedding a background image in pdfmake

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…
Varvara Jones
  • 761
  • 2
  • 8
  • 25
11
votes
2 answers

How to fill column background color for pdfmake with fillColor?

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 :(
Mo.
  • 26,306
  • 36
  • 159
  • 225
1
2 3
37 38