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

ch.dvbern.oss.invoicegenerator:invoice-generator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ch.dvbern.oss.invoicegenerator:invoice-generator

This Java library can be used to generate PDF documents like letters and invoices.

  • 7.0.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

DV Bern Invoice Generator Library

This library can be used to create PDF invoices with or without a payment slip.

Usage

  1. Create an InvoiceGeneratorConfiguration. This contains the layout for invoices (Header, Footer, Bank account, ...). There are also static elements available, that remain the same for all invoices, such as payment conditions.
  2. An InvoiceGenerator instance can now be created with the InvoiceGeneratorConfiguration.
  3. The InvoiceGenerator can now be used to create PDF invoices from Invoice objects. (bearbeitet)

private final InvoiceGeneratorConfiguration configuration = new InvoiceGeneratorConfiguration(Alignment.LEFT);
InvoiceGenerator invoiceGenerator = new InvoiceGenerator(configuration);
final Invoice invoice = new Invoice(columnTitle, titel, summary, einleitung, adresse, einzahlungsschein, positionen, total);
invoiceGenerator.generateInvoice(Files.newOutputStream(Paths.get("target/Invoice.pdf")), invoice);

Configuring fonts

To be able to use specific fonts, in particular the OCR-B font, required for the coding line of the payment slip, the fonts must be registered before they are accessed, e.g.

FontFactory.register("/font/br_ocrb.ttf", FontConfiguration.FONT_FACE_OCRB);
Font ocrbFont = FontFactory.getFont(FontConfiguration.FONT_FACE_OCRB);

The FontConfiguration can be used as a container for the default fonts of the generator. You can define your own FontConfiguration and set it in PageConfiguration.

FAQs

Package last updated on 27 May 2024

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