Back to Blog
Tutorial

How to Generate a PDF from a Template (Without Writing Code)

A step-by-step walkthrough of setting up a template, connecting your data, and exporting a production-quality PDF in GJSDocs — no developer required.

April 2026·6 min read

Why template-to-PDF matters

Generating a PDF from a template solves one of the most common time drains in business operations: manually editing the same document over and over with different client or transaction data. A proposal, a contract, an invoice — the structure stays the same. Only the names, dates, and amounts change.

The traditional approach is to open a Word or Google Docs template, edit the fields, export to PDF, rename the file, and store it somewhere. For low volumes this is annoying. For high volumes — fifty invoices a month, hundreds of renewal letters — it becomes a serious operational bottleneck.

The better approach: build the template once, connect your data source, and let the software generate PDFs automatically whenever you need them. This guide walks through exactly how to do that in GJSDocs.

What you'll need

  • A GJSDocs account (free trial, no credit card required)
  • Your document content — the text, structure, and branding you want in the PDF
  • A data source with the variable values — Google Sheets, Airtable, HubSpot, or just values you type in manually

Step 1 — Create your template

Log in to GJSDocs and navigate to Templates. Click New Template and give it a name — "Client Invoice" or "Service Agreement," something you'll recognize.

The template opens in the full-screen visual editor. This is where you build the layout of your document. The editor is organized in three panels: a variable panel on the left, the document canvas in the center, and layout/element blocks on the right.

Start by adding layout blocks: a Page block to define the document dimensions, then Column and Text blocks to build your content sections. For a basic invoice, you'd typically have a header section (company name, logo), a recipient section (client name and address), a line items table, and a payment terms section at the bottom.

Adding variable placeholders

Variables are the engine of template automation. Wherever you want dynamic content to appear in the finished document, type a variable placeholder using the {variable.name} syntax.

For an invoice template, common variables look like:

Bill To: {client.name}

Email: {client.email}

Invoice #: {invoice.number}

Date: {invoice.date}

Due Date: {invoice.due_date}

Amount Due: {invoice.total}

The variable panel on the left side of the editor shows all variables defined in your workspace. You can type variable names manually in the canvas, or click the variable chip in the panel to insert it at your cursor position. At generation time, every placeholder is replaced with the real value from your data source.

Step 2 — Connect your data

GJSDocs connects to Airtable, Google Sheets, HubSpot, and Zapier as native integrations. To connect, go to Workspace > Integrations and click the integration you want to set up.

Once connected, you map your data source fields to GJSDocs variable names. If your Airtable base has a column called "Client Name," you map it to the {client.name} variable used in your template. GJSDocs handles the data fetching and variable substitution at generation time.

If you're not using an integration — for example, you're generating a single one-off document — you can enter variable values manually in the variable panel on the left side of the editor. Type the value next to each variable name and proceed to generation.

You can also trigger PDF generation via the GJSDocs API. POST the variable values in the request body along with the template ID, and the API returns a URL to the generated PDF. This is how teams integrate GJSDocs into automated billing pipelines, CRM workflows, or backend applications.

Step 3 — Generate and export the PDF

With your template saved and your data connected, generating the PDF takes seconds. Navigate to the Generate section in the left navigation, select your template, choose or enter the data source record, and click Generate.

GJSDocs renders the document at full quality — exact fonts, layout, and spacing as designed — and produces a download link for the PDF. You can also export to DOCX, HTML, Markdown, or JSON format using the format selector in the export menu.

For bulk generation, connect to your Airtable base or Google Sheet, select all records you want to process, and run a batch job. GJSDocs generates a separate PDF for each record in parallel and makes all files available for download, either individually or as a ZIP archive.

Tips for better templates

  • Use consistent variable naming conventions — {client.name} and {client.email} are clearer than {cn} and {e}. Variable names should be readable in the template without needing a legend.
  • Test with live data before finalizing the template. Use the Preview button to see exactly how the finished PDF will look with real variable values filled in.
  • Group related variables. If you have five client-related variables, prefix them all with "client." — this makes the variable panel easier to scan and the template easier to read.
  • Keep the template lean. Every unused variable is a potential empty field in the finished document. Remove variables you don't actually use rather than leaving them as blanks.
  • Import existing templates. If you have an existing DOCX you've been using manually, use the GJSDocs import tool to convert it into an editable template in one step.

What to do next

Once you've generated your first PDF from a template, the natural next step is to automate the trigger. Instead of manually clicking Generate each time, you can:

  • Set up a Zapier automation that triggers PDF generation when a new row appears in Google Sheets or a deal moves to a new stage in HubSpot
  • Call the GJSDocs API from your backend when a billing event fires, and attach the generated PDF to the email notification
  • Use the batch generation UI to process a full Airtable base at the start of each billing cycle

Build your first PDF template

Start with a free account. Your first template takes about 15 minutes to set up — and generates in seconds every time after that.

Start free