New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

adonis-pdf

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adonis-pdf

Create PDF files within Adonis using pdfmake

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-42.31%
Maintainers
1
Weekly downloads
 
Created
Source

adonis-pdf

Service provider for building PDFs using pdfmake.

Installation

  • Run npm i adonis-pdf or yarn add adonis-pdf
  • Create config/pdf.js and set any custom fonts you wish to use:
module.exports = {
  fontDescriptors: {
    // my fonts here
  }
}
  • Add 'adonis-pdf/providers/PdfProvider' to start/app.js

Usage

'use strict'

const Pdf = use('Pdf')

class MyController {

  async generatePdf ({ response }) {
    const pdf = new PDF({
      // custom config (this will override config/pdf.js )
    })
    const doc = Pdf.create({
      content: [
        { text: 'test' }
      ]
    })

    doc.pipe(response.response)
    doc.end()

    return response
  }

}

Keywords

FAQs

Package last updated on 07 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc