https://github.com/janczer/htmlpdf
Create PDF from HTML
https://github.com/janczer/htmlpdf
go golang html pdf
Last synced: 6 months ago
JSON representation
Create PDF from HTML
- Host: GitHub
- URL: https://github.com/janczer/htmlpdf
- Owner: janczer
- License: mit
- Created: 2017-01-17T20:09:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-24T20:35:01.000Z (about 8 years ago)
- Last Synced: 2025-08-13T20:44:06.794Z (11 months ago)
- Topics: go, golang, html, pdf
- Language: Go
- Homepage:
- Size: 48.8 KB
- Stars: 25
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Package for create pdf from html
Implement series article [Let's build a toy browser engine!](https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html)
Install:
go get github.com/janczer/htmlPDF
go get github.com/jung-kurt/gofpdf
Exemple:
First you need create 3 files. With html tags, css style and Go code:
`first.html`:
`style.css`:
* { display: block; padding: 5px; }
.a { background: #ff0000; }
.b { background: #ffa500; }
.c { background: #ffff00; }
.d { background: #008000; }
.e { background: #0000ff; }
.f { background: #4b0082; }
.g { background: #800080; }
`main.go`:
package main
import "github.com/janczer/htmlPDF"
func main() {
htmlPDF.Generate("first.html", "style.css", "hello.pdf")
}

### Todo:
- [ ] Add support Anonymous block
- [ ] Add support Inline block
- [ ] Add use CSS from style tag ``