Documentation
¶
Overview ¶
Package pdfhtml contains the pdf-html node: it renders HTML and CSS from a message property to a PDF document fully in-process through github.com/carlos7ags/folio. The node is in the opt-in pdfs pack so consumers only pay Folio's dependency weight when they import the pack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Property is the message property containing HTML text. It defaults
// to payload and supports the shared whole-property lookup convention.
Property string `json:"property"`
// Filename is the suggested output filename stamped into file metadata.
Filename string `json:"filename"`
}
Config holds the pdf-html node configuration.
type Node ¶
Node renders HTML input to PDF bytes. 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 NewNode ¶
func NewNode(node nodestore.NodeInterface, cfg *Config) *Node
NewNode creates a new pdf-html node.
func (*Node) Execute ¶
func (n *Node) Execute(ctx context.Context, in nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute renders the configured HTML input property and stamps file metadata.