json-gofpdf runs JSON schema through gofpdf to generate PDFs in server-side.
- Maps JSON schema to gofpdf functions.
- Inject data into your schema layouts for dynamic information.
logic := `[
{
"new": {
"orientation": "P",
"unit": "mm",
"size": "A4",
"fontDir": ""
}
},
{
"addpage": {}
},
{
"setfont": {}
},
{
"cell": {
"width": 40.0,
"height": 10.0,
"text": "Hello, World!"
}
}
]`
pdfparser2, err := jsongofpdf.New(jsongofpdf.JSONGOFPDFOptions{Logic: logic})
if err != nil {
fmt.Println(err)
}
pdf2 := pdfparser2.GetPDF()
pdf.OutputFileAndClose("hello.pdf")
- AddPage
- AliasNbPages
- Body
- Cell
- CellFormat