pdfhtml

package
v0.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

PDF HTML node

Type: pdf-html
Category: Document

Renders HTML/CSS from a message property to a PDF document fully in-process.

Behavior

This node is registered as pdf-html in the opt-in pdfs pack. It reads HTML text from the configured input property, renders it with Folio, replaces msg.payload with PDF bytes, and stamps the standard file metadata (msg.filename and msg.file).

The node does not implement a templating language. Compose template or change nodes before it when dynamic HTML is needed. Document-referenced remote and local assets are not fetched; embed assets as data URIs. HTML input is limited to 2 MiB.

Folio may load a Unicode fallback font from standard system font locations when text cannot be encoded by the built-in PDF fonts. That lookup is not document-controlled, but it means output for non-WinAnsi text can depend on the host's installed fonts. The host-controlled fallback font read is outside the document asset budget, so very large system fonts can increase rendering memory use.

Configuration

Field Type Default Description
filename string document.pdf Filename — Suggested file name stamped into msg.filename / msg.file.suggestedName
property string payload Input Property — Message property containing HTML text (payload, payload.* or msg.*). Output PDF bytes always replace msg.payload. Input is limited to 2 MiB.

Implementation

  • node.go contains the executor, validation, schema, and registration.
  • editor.html contains the editor integration.
  • node_test.go contains behavioral tests.

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

type Node struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

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

Execute renders the configured HTML input property and stamps file metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL