Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-html-pdf-converter

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-html-pdf-converter

A Node-RED node to convert HTML to PDF without using a browser.

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-17.65%
Maintainers
0
Weekly downloads
 
Created
Source

node-red-contrib-html-pdf-converter

Description

The node-red-contrib-html-pdf-converter node allows you to convert HTML content into a PDF file. This node is useful for generating PDF reports or documents from HTML content within your Node-RED flows.

Installation

To install this node, use the Node-RED Palette Manager or install it directly via npm:

npm install node-red-contrib-html-pdf-converter

Usage

The node-red-contrib-html-pdf-converter node converts HTML content received on its input into a PDF file and saves it to a specified directory.

Configuration

PDF Name

Specify the base name for the generated PDF file. The node will automatically append a counter to ensure that each file name is unique.

  • Example: report This will generate files like report_1.pdf, report_2.pdf, etc.

Save Path

The path where the PDF files will be saved. This path is fixed to node-red/PDFs/ and is displayed as read-only in the configuration.

Example Flow

Here is an example flow to use the node-red-contrib-html-pdf-converter node:

[
    {
        "id": "html-to-pdf-node",
        "type": "html-to-pdf",
        "name": "Generate PDF",
        "pdfName": "report",
        "x": 300,
        "y": 200,
        "wires": [
            [
                "debug-node"
            ]
        ]
    },
    {
        "id": "inject-node",
        "type": "inject",
        "name": "Inject HTML",
        "payload": "<h1>Hello World</h1>",
        "payloadType": "str",
        "topic": "",
        "x": 100,
        "y": 200,
        "wires": [
            [
                "html-to-pdf-node"
            ]
        ]
    },
    {
        "id": "debug-node",
        "type": "debug",
        "name": "Debug Output",
        "active": true,
        "x": 500,
        "y": 200,
        "wires": []
    }
]

Details

node-red-contrib-html-pdf-converter Node Configuration

  • PDF Name: The base name for the PDF file. The node appends a counter to ensure uniqueness.
  • Save Path: The fixed path where the PDFs are saved. Displayed as read-only.

Notes

  • Ensure that Node-RED has the necessary permissions to write to the node-red/PDFs/ directory.
  • The node automatically increments the counter to avoid overwriting existing files with the same name.

Contributing

If you have suggestions or improvements, feel free to contribute to the repository or open an issue.

License

This node is licensed under the MIT License.

Keywords

FAQs

Package last updated on 08 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc