{
  "id": "DpHO7BwAZOzx9rMs",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Job to PDF",
  "tags": [],
  "nodes": [
    {
      "id": "6a063c7c-07de-4972-9059-78653e462658",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -420,
        -160
      ],
      "parameters": {
        "options": {},
        "formTitle": "Job Posting Form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Job Position",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "Salary",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Responsibilities",
              "requiredField": true
            },
            {
              "fieldLabel": "Office Location",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ac91a3f6-b09b-4ef2-88c3-622c31e21e84",
      "name": "Dropbox",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        -200,
        -160
      ],
      "parameters": {
        "path": "/Foxit/docgen_sample_job_offer.docx",
        "operation": "download",
        "authentication": "oAuth2"
      },
      "credentials": {
        "dropboxOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "43fbf7c3-12ca-434a-aa69-9a525036d2d5",
      "name": "Document Generation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        -160
      ],
      "parameters": {
        "url": "https://na1.fusion.foxit.com/document-generation/api/GenerateDocumentBase64",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n\"outputFormat\":\"pdf\",\n\"currencyCulture\":\"en-US\",\n\"base64FileString\":\"{{ $json.data }}\",\n\"documentValues\":{\n  \"jobPosition\":\"{{ $('On form submission').item.json['Job Position'] }}\",\n\"salary\":{{ $('On form submission').item.json.Salary }},\n\"office\":\"{{ $('On form submission').item.json['Office Location'] }}\",\n\"responsibilities\":\"{{ $('On form submission').item.json.Responsibilities }}\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpCustomAuth"
      },
      "credentials": {
        "httpCustomAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0020993b-45e0-4197-823a-710a60ba9cae",
      "name": "Convert Word to B64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        20,
        -160
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "4b8ce696-6828-401e-b0e9-54d2ea14049e",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        460,
        -160
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "base64FileString"
      },
      "typeVersion": 1.1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "36411980-23bc-4fe3-82b3-95f931e1f046",
  "connections": {
    "Dropbox": {
      "main": [
        [
          {
            "node": "Convert Word to B64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        []
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Dropbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Word to B64": {
      "main": [
        [
          {
            "node": "Document Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document Generation": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}