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
0
votes
1 answer

canvas image gets blurry

https://jsfiddle.net/Abhi_Solanki/9yktct3z/3/ here fiddle link..what i am trying to do is to show the same output as the highcharts show when it is exported in PDF format or SVG format, infact in this code i have used the same function that…
Abhishek Solanki
  • 43
  • 1
  • 1
  • 8
0
votes
1 answer

pdfmake: Fixed Column Height

I want to add text to a column and i would like that column to have a fixed height and width. I've managed to add a fixed width but i'm unable to add a fixed height. Here's my code: { columns: [ { width: 200, …
Ricky
  • 2,912
  • 8
  • 47
  • 74
0
votes
1 answer

Multiple fonts in pdfMake for dynamic content

I am working with pdfMake, that converts the static text into pdf. My text in HTML is coming from a service in AngularJS and is dynamic. The text can have both English as well as non-English characters like Korean, Japanese, Chinese, etc. Currently,…
Shashank
  • 2,010
  • 2
  • 18
  • 38
0
votes
2 answers

Base64 encoding an image alerts correct, response is nil

I'm trying to encode an image in Base64 from a URL. function getBase64Image(url) { var img = new Image(), response = ''; img.setAttribute('crossOrigin', 'anonymous'); img.onload = function() { var canvas =…
t56k
  • 6,769
  • 9
  • 52
  • 115
0
votes
1 answer

Creating and exporting a table using PDF MAKE

I created a UI grid and exported the grid to print as a pdf with the click of a button. I used these exporters: exporterHeaderFilterUseName: true, exporterLinkLabel: 'get your csv here', exporterPdfDefaultStyle: {fontSize:…
Adrew
  • 217
  • 1
  • 8
  • 25
0
votes
1 answer

Export fusioncharts to pdfMake

I am building a report with pdfMake in which I need to include some charts rendered at the web page with fusioncharts. The available client-side export options provided by fusioncharts aren't working for me because I need to obtain the image file…
efTobark
  • 11
  • 3
0
votes
1 answer

How can align only one column in pdfmake export of datatables.js?

I have managed to edit the pdf export but i need to align only one column i searched in thes datatables forum and in the pdfmake documentation but i haven't find how to do it. Please help! My customize function is the following customize: function (…
anguswild
  • 323
  • 4
  • 16
0
votes
1 answer

How to print the carry over columns of ui-grid on the next page using pdfmake

I am trying to print an angular ui-grid with 30 columns and it cuts off at 15 columns. How can I print the remaining 15 columns on the next page. This is how I am generating a pdf. gridApi.exporter.pdfExport(uiGridExporterConstants.VISIBLE,…
Ashu
  • 1
  • 1
0
votes
1 answer

Pdfmake.js and json as content

When I try to put an json as content it does render as a whole string. So I see the json syntax in the pdf, instead of the formated. What did I miss? var docDefinition = { content: jsonObj, styles: { header: { fontSize: 22, bold: true }, …
user1308302
  • 193
  • 9
0
votes
1 answer

Pdfmake.js issue with mozilla browser(latest version)

I have adopted the pdfmake.js library into my angular js project for generating PDF's.Its implemented well and works very fine with google chrome(all versions) and mozilla(only some versions). In mozilla latest version (50.0.0),can't generate Pdf.…
basith
  • 740
  • 4
  • 13
  • 26
0
votes
1 answer

Attach Pdf to email composer in ionic

i am trying to attach the blob pdf file to email composer . But it is not working for me. function createPdf(reportData){ return $q(function(resolve, reject) { var dd = createDocumentDefinition(reportData); var pdf =…
Suraz Khanal
  • 222
  • 1
  • 5
  • 17
0
votes
1 answer

Implementation of pdfmake in Angularjs2/Ionic2

I am creating an application in ionic 2 framework(based on angularjs2). Here i am providing data in forums and this data is shown by the pdf. can anyone please tell how to install pdfmake in angularjs2 or ionic 2 and some basic snippets to use.
im_bhatman
  • 896
  • 1
  • 18
  • 28
0
votes
0 answers

Execute function for each index in array

Im using the pdfmake to create client-side pdf. I have a function that creates the pdf and I have a array with data. function createPDF(data) { var docDefinition = { ... }; pdfMake.createPdf(docDefinition).download(data.customer +…
0
votes
0 answers

Dotted line in pdf file with IE 10

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…
Kai
  • 345
  • 1
  • 2
  • 11
0
votes
1 answer

PdfMake Displaying Dynamic data with styling

I am using PdfMake to generate a pdf on the client side. I store a list of skills in an array like so: var skills: ["hiking", "running", "typing", "etc"]; I am trying to show this array of skills like this similar to stack overflow (with styling…
Skywalker
  • 4,984
  • 16
  • 57
  • 122