Socket
Socket
Sign inDemoInstall

template-pdf-generator

Package Overview
Dependencies
13
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

4

generator.js
const wkhtmltopdf = require('wkhtmltopdf');
const Twig = require('twig'), twig = Twig.twig;
const pdfGenerator = function(data, template, css) {
const pdfGenerator = function(data, template, css, options) {
const renderedTemplate = `<html>

@@ -18,5 +18,5 @@ <head>

return wkhtmltopdf(renderedTemplate);
return wkhtmltopdf(renderedTemplate, options);
}
module.exports = pdfGenerator;
{
"name": "template-pdf-generator",
"version": "1.0.1",
"version": "1.0.2",
"description": "Generate a pdf from a template and some json data.",

@@ -5,0 +5,0 @@ "main": "generator.js",

# Génération de pdf à partir de données
Ceci est un petit script en node qui permet de générer un pdf, à partir de données au format json et d'un template [twig](https://twig.symfony.com/).
Il utilise [wkhtmltopdf](https://wkhtmltopdf.org/).
Il utilise [wkhtmltopdf](https://wkhtmltopdf.org/). Il faut que wkhtmltopdf soit installé.

@@ -6,0 +6,0 @@ ### Installation :

# Template pdf generator
This is a small nodejs-script that generates a pdf-file, given some data and a [twig](https://twig.symfony.com/) template.
It uses [wkhtmltopdf](https://wkhtmltopdf.org/).
It uses [wkhtmltopdf](https://wkhtmltopdf.org/) through the [wkhtmltopdf node package](https://github.com/devongovett/node-wkhtmltopdf). wkhtmltopdf has to be installed.

@@ -29,2 +29,8 @@ ### Installation

You can also use some options:
```
pdfGenerator(data, template, css, options)
```
The `options` object is the same as documented in the [wkhtmltopdf node package](https://github.com/devongovett/node-wkhtmltopdf#options).
### Usage as a command line tool

@@ -31,0 +37,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc