Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otanriverdi/invoice-pdf-generator
https://github.com/otanriverdi/invoice-pdf-generator
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/otanriverdi/invoice-pdf-generator
- Owner: otanriverdi
- Created: 2021-09-21T12:31:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-21T12:32:49.000Z (about 3 years ago)
- Last Synced: 2024-06-21T16:55:12.461Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PDF Generator
The goal with this.
1. Create a PDF invoice given some data about a customer's recent transactions
### Creating a PDF invoice
Given data like the following, generates a PDF invoice.
```go
data := []struct {
UnitName string
PricePerUnit int
UnitsPurchased int
}{
{
UnitName: "2x6 Lumber - 8'",
PricePerUnit: 375, // in cents
UnitsPurchased: 220,
}, {
UnitName: "Drywall Sheet",
PricePerUnit: 822, // in cents
UnitsPurchased: 50,
}, {
UnitName: "Paint",
PricePerUnit: 1455, // in cents
UnitsPurchased: 3,
},
}
```