Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wrapper for pdfmake

pdfmake iframe wrapper for react on node and express

pdfmake is only loaded in iframe and only when you request print, open or save commands (because it's somewhat large library).

How to use pdfmake and create document definitions - http://pdfmake.org/

Install:

npm install --save artursgirons/node-react-pdfmake#master

Mount assets:

import mountCreatePdfApp from 'node-react-pdfmake/node'
...
app.use('/createpdf', mountCreatePdfApp())

Create component:

import CreatePDF from 'node-react-pdfmake/component'
...
<div>
  ...
  <CreatePDF path='/createpdf' ref='createpdf' definition={this.getPDFDefinition()} name='document' />
  ...
</div>
...
this.refs.createpdf.open()
this.refs.createpdf.print()
this.refs.createpdf.save()
...
getPDFDefinition() {
  return { content: 'PDF content' }
}

About

Pdfmake iframe wrapper for react on node and express

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages