Overview

This page is a developer reference for the Document Template Creator form. It shows the live form, documents every configurable option, and provides the complete embeddable HTML. Copy the source, drop it into any webpage, and update the settings described below.

How it works

What the form does

Accepts a PDF or DOCX upload and an optional context note, then POSTs both to an n8n webhook as multipart/form-data. The workflow classifies the document type, identifies all variable fields, generates a fill-in-the-blank template, and returns links to the finished PDF in Google Drive.

Dependencies

What you need

No external libraries. Pure HTML, CSS, and vanilla JavaScript — no frameworks, no CDN links. Works in all modern browsers. Requires the n8n workflow to be active and reachable from the user's browser.

Embedding

Where to put it

Drop the HTML source into any page. Works standalone, inside a WordPress page (paste into the HTML block), inside an <iframe>, or embedded in a Webflow / Elementor page using a custom HTML component.

Live form preview

This is the actual form — fully interactive. File upload, drag-and-drop, and form submission all work. Submitting will call the configured webhook URL.

Document template creator

Upload any PDF or Word document — AI identifies the document type and generates a reusable fill-in-the-blank template.

Document
Drop file here or click to browse
PDF or DOCX · max 20 MB
Additional context (optional)
Configuration

All configurable values are declared as constants or CSS properties near the top of the source. The table below documents each one.

Setting Where to find it Required Description
WEBHOOK_URL Top of <script> Required The full n8n webhook URL. Replace with your production endpoint when going live.
Header background .form-headerbackground Optional Default is #002657 (navy). Change to any hex value to match your brand.
Button color .submit-btnbackground Optional Default is #FA4616 (orange). Change to your primary CTA color.
Drop zone color .drop-zonebackground and border-color Optional Default uses blue ramp (#E6F1FB fill / #378ADD border). Change both for a different accent.
Subtitle text color .form-header pcolor Optional Default is #85B7EB. Adjust if using a lighter header background.
Page background bodybackground Optional Default is #f4f5f7. Remove or change if embedding inside a colored container.
Max file size label .drop-hint inner text Optional Display-only label. To enforce a size limit, add a check in fOnFileChange() comparing file.size to your limit in bytes.
Accepted file types input[type="file"]accept Optional Default is .pdf,.docx. Extend if the workflow supports additional formats.
Setting the webhook URL

The webhook URL is the only value you must change before deploying the form to production.

Test vs. production: n8n provides two webhook URLs per workflow — a test URL (active only when the workflow is open in the editor) and a production URL (always active when the workflow is enabled). Always use the production URL on a live site.
Step 1

Find your webhook URL

Open your n8n workflow. Click the Webhook trigger node. Copy the Production URL shown in the node panel. It will look like:

https://your-n8n.com/webhook/general-template-creator

Step 2

Update the constant

In the HTML source, find this line near the top of the <script> block and replace the URL:

const WEBHOOK_URL = 'https://...';

CORS

If you see CORS errors

The form submits from a browser, so the n8n instance must allow cross-origin requests from your domain. In n8n, open the Respond to Webhook node and confirm the Access-Control-Allow-Origin header is set to * or your specific domain.

Customizing colors

The form uses a small set of named colors. All are hardcoded hex values in the CSS — search and replace any of them to retheme the form.

Navy
#002657
Header background
Orange
#FA4616
Submit button
Blue mid
#378ADD
Drop zone border
Blue light
#E6F1FB
Drop zone fill, file chip
Blue pale
#85B7EB
Header subtitle text
Blue dark
#0C447C
Drop zone text, file ext
Green light
#EAF3DE
Success message background
Red light
#FCEBEB
Error message background
Request & response payload

The form sends a multipart/form-data POST. The workflow returns JSON. Both are documented below.

Request fields

file binary // The uploaded PDF or DOCX file fileName string // Original filename including extension, e.g. "contract.pdf" additionalContext string // Optional. Plain text hint for the AI, omitted if blank

Response (success)

{ "success": true, "classification": { "documentType": "Service Agreement", // AI-identified doc type "description": "A contract between...", // One-sentence description "fieldsIdentified": 14 // Total placeholder count }, "template": { "filename": "service_agreement_template_2026-04-11.pdf", "googleDriveId": "1aBcDeFgHiJk...", "viewUrl": "https://drive.google.com/file/d/...", "directDownload": "https://drive.google.com/uc?export=download&id=..." }, "fields": [ // Array of identified placeholders { "placeholder": "[CLIENT_NAME]", "description": "Full legal name of the client" }, { "placeholder": "[EFFECTIVE_DATE]", "description": "Date the agreement takes effect" } ] }

Response (error)

{ "success": false, "message": "Description of what went wrong" }
HTML source code

Complete standalone HTML file. Copy and paste into any webpage, HTML block, or custom code component. Update WEBHOOK_URL before deploying.

template-creator-form.html
`; document.getElementById('mainCodeBody').textContent = formSource; function copyMain() { navigator.clipboard.writeText(formSource).then(() => { const btn = document.getElementById('mainCopyBtn'); btn.textContent = 'Copied'; btn.classList.add('copied'); setTimeout(() => { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 2500); }); }