https://github.com/rogchap/pdfgo
https://github.com/rogchap/pdfgo
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rogchap/pdfgo
- Owner: rogchap
- Created: 2024-03-17T10:00:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-15T23:29:31.000Z (about 1 year ago)
- Last Synced: 2025-04-11T05:42:34.712Z (3 months ago)
- Language: Go
- Size: 684 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PDF Go
PDF Go is a powerful, open source, PDF generation library for the Go programming language.
## Feature
* Powerful layout engine
* Page layers (great for watermarks)
* horizontal and vertical stacks
* Page headers and footers
* Automatically wrap content over multiple pages
* Comprehensive text rendering
* Text styles (italic, bold, color, line height etc)
* Fonts manager including system fonts (yes, color emoji support 😍)
* Font family substitutions (fallback)
* Font subsetting (reduce PDF file size)
* Font shaping (support Arabic fonts)
* Right-to-left (RTL) content (Note: WIP)
* Page numbering
* Customizable styling
* Background colors
* Container border styles, including corner radius* ...
## Usage
This project is a WIP; no release has been made, and is pre-v0.1
## Example
```go
type myDoc struct {}func (d *myDoc) Build(b *pdf.Doc) {
d.Page(func(page *pdf.Page) {
page.Content().
Text("PDF Go").FontSize(64)
}
}func main() {
f, _ := os.Create("output.pdf")
defer f.Close()
pdf.Generate(f, &myDoc{})
}
```## Acknowledgements
This library is has been inspired by the great work done by [Marcin Ziąbek](https://github.com/MarcinZiabek) and the [QuestPDF](https://www.questpdf.com/) community.