npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

n8n-nodes-doc-fill

v0.2.1

Published

Node made to fill a PDF form.

Downloads

30

Readme

n8n-nodes-doc-fill

This repo contains two n8n nodes:

  • Doc Fill which, given a PDF with a form as input, retrieves the fields based on the given keys and inserts the given value for the retrieved field.
  • Doc Create Field which adds a text to a given page's coordinates.

Doc Fill

Doc Fill takes a PDF as input and 3 parameters: Property Name, Property Name Out, Configuration JSON.

  • Property Name should be the internal name representing the PDF file given as input (default is 'data').
  • Property Name Out is the internal name you want to give to the output PDF file (default is 'data').
  • Configuration JSON is a JSON following the structure given below to specify which fields you want to change.

Configuration JSON structure

This is the base structure to configure one field, Configuration JSON is expecting an array of this structure.

interface DocFillConfig {
    key: string;
    value: string;
    type: 'textfield' | 'checkbox' | 'dropdown' | 'radiogroup';
}
  • key: The key to find and retrieve the field in the PDF Form.
  • value: The value you want to insert for the retrieved field (must be 'true' (check) or 'false' (uncheck) for checkbox field type).
  • type: The type of field you want to retrieve (can be 'textfield', 'checkbox', 'dropdown' or 'radiogroup').

Example

[
  {
    "key": "keyOfMyTextField",
    "value": "John Doe",
    "type": "textfield"
  },
  {
    "key": "keyOfMyCheckbox",
    "value": "true",
    "type": "checkbox"
  }
]

Doc Create Field

Doc Create Field takes a PDF as input and 3 parameters: Property Name, Property Name Out, Configuration JSON.

  • Property Name should be the internal name representing the PDF file given as input (default is 'data').
  • Property Name Out is the internal name you want to give to the output PDF file (default is 'data').
  • Configuration JSON is a JSON following the structure given below to specify the text you want to draw and how/where you want to draw it.

Configuration JSON structure

This is the base structure to draw one text, Configuration JSON is expecting an array of this structure.

interface DocCreateFieldConfig {
    page: number,
    value: string;
    options: {
        x: number,
        y: number,
        size: number | undefined,
        opacity: number | undefined,
        colorRed: number | undefined,
        colorGreen: number | undefined,
        colorBlue: number | undefined,
    }
}
  • page: The page in the PDF on which you want to draw your text.
  • value: The text you want to draw.
  • options.x: Position on the x axis where you want to start drawing the text.
  • options.y: Position on the y axis where you want to start drawing the text.
  • options.size: Size of the text you want to draw. (optional, default is 24)
  • options.opacity: Opacity of the text you want to draw, must be between 0 and 1. (optional, default is 1)
  • options.colorRed: Red value of the RGB color representation. (optional, default is 0)
  • options.colorGreen: Green value of the RGB color representation. (optional, default is 0)
  • options.colorBlue: Blue value of the RGB color representation. (optional, default is 0)

Example

[
  {
    "page": 0,
    "value": "this is a test!",
    "options": {
      "x": 300,
      "y": 30,
      "size": 12
    }
  }
]