Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swiss-bill-generator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swiss-bill-generator

Creates PDFs for Swiss ESR Payment

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

swiss-bill-generator

Creates PDFs for Swiss ESR Payment

Usage

Specify your options

var opts = {
    amount: '3949.75',
    account: '01-92722-7',
    issuer: 'TestFirma GmbH\nTestweg 723\n3072 Ostermundigen',
    billTo: 'Hans Mustermann\nMusterstrasse 28\n3012 Bern'
    ref: '313947143000901'
};

Save to a file

var SwissBill = require('SwissBill');
var bill = new SwissBill(opts);
bill.savePDF('bill.pdf');

Add additional data

See http://pdfkit.org/ for more information.

var fs = require('fs');
var SwissBill = require('SwissBill');
var bill = new SwissBill();
var doc = bill.getPDF();
doc.text('Hello');
doc.moveDown().text('I hope you are enjoying this library!');
doc.moveDown().moveDown().text('See you soon');
doc.moveDown().moveDown().text('Invoice date: ' + Date());
doc.pipe(fs.createWriteStream('bill.pdf'));
doc.end();

Send to HTTP response (browser download)

var SwissBill = require('SwissBill');

// Express 4.x style
router.get('/', function(req, res) {
    var filename = 'bill.pdf';
    res.set({
        "Content-Disposition": 'attachment; filename="' + filename + '"'
    });

    var bill = new SwissBill(opts);
    bill.pipe(res);
};

FAQs

Package last updated on 11 Jul 2014

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