### Generate PDF Invoice from Order Data Source: https://unidoc.io This function generates a PDF invoice based on order details using a template. It requires the `creator` package from UniDoc and an `Order` struct. The output is written to an `io.Writer`. ```go func GenerateInvoice(order Order, w io.Writer) error { c := creator.New() c.SetPageSize(creator.PageSizeLetter) tpl, _ := c.NewTemplate("invoice.tpl") tpl.SetContext(map[string]any{ "order_id": order.ID, "total": order.Total, "items": order.Items, }) return c.Write(w) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.