@jtanguay/n8n-nodes-svg-converter
v0.1.1
Published
n8n community node to convert SVG input into PNG binary data or Base64-encoded PNG.
Maintainers
Readme
n8n-nodes-svg-converter
This is an n8n community node. It converts SVG input into either:
- a PNG binary file,
- a Base64-encoded PNG string,
- or both at once.
It supports SVG input from:
- a direct text field,
- a JSON field from the incoming item,
- or a binary property containing an SVG file.
Installation
In your self-hosted n8n instance, install from npm:
npm install n8n-nodes-svg-converterOr install it from the Community Nodes UI in n8n.
Operations
Convert SVG
Input sources:
- SVG text
- JSON field
- Binary property
Output modes:
- PNG Binary
- Base64
- Both
Parameters
- Source: Where the SVG comes from.
- SVG: Raw SVG markup when using direct input.
- JSON Field Name: Field containing the SVG markup.
- Input Binary Property: Binary field containing the SVG file.
- Output:
PNG Binary,Base64, orBoth. - PNG Binary Property: Binary property name for the rendered PNG.
- Base64 Field Name: JSON field name for the Base64 string.
- File Name: Optional output PNG file name.
- Width / Height: Optional raster size.
- Density: SVG render density used by sharp.
- Background Color: Optional flatten background. Leave empty for transparency.
Example
Direct SVG text to PNG
- Add the SVG Converter node.
- Set Source to
SVG Text. - Paste SVG markup into SVG.
- Set Output to
PNG Binary. - Run the node.
JSON field to Base64
If an incoming item contains:
{
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"40\"><text x=\"10\" y=\"25\">Hello</text></svg>"
}then set:
- Source →
JSON Field - JSON Field Name →
svg - Output →
Base64
The node will write the Base64 PNG string to the configured field.
Development
npm install
npm run devLicense
MIT
