An open API service indexing awesome lists of open source software.

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

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")
}

![render](hello.jpg)

### Todo:


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