Documentation
¶
Overview ¶
Package pdf contains the pdf node: it renders the incoming payload to a PDF document (invoices, reports). Two modes: "text" (payload string becomes a paginated text PDF) and "template" (payload {title, fields, table, body} drives a report layout).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PDFConfig ¶
type PDFConfig struct {
// Mode: "text" (payload string -> paginated text PDF) or
// "template" (payload drives a title/fields/table layout).
Mode string `json:"mode"`
Filename string `json:"filename"`
// Title is the heading for template mode; a payload "title" key
// wins when present.
Title string `json:"title"`
}
PDFConfig holds the `pdf` node configuration.
type PDFNode ¶
PDFNode renders the incoming payload to a PDF document. Output: msg.Payload = PDF bytes; Metadata["file"] carries {suggestedName, contentType:"application/pdf", size} and Metadata["filename"] the suggested name so a `file` node with filenameType "msg" writes it directly.
func NewPDFNode ¶
func NewPDFNode(node nodestore.NodeInterface, cfg *PDFConfig) *PDFNode
NewPDFNode creates a new pdf node.
func (*PDFNode) Execute ¶
func (n *PDFNode) Execute(ctx context.Context, in nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute renders the payload to PDF and stamps the file metadata.