ScreenshotNeo

BlogGuides

Bubble Integration: Generate Documents in Your Bubble App

Generate invoices, reports, certificates, and PDFs in Bubble with plugins or the API Connector. Compare options, configure workflows, and avoid common failures.

By the ScreenshotNeo team1 October 20268 min read

Direct answer: Bubble can generate documents in two practical ways: install a document-generation plugin, or connect Bubble’s API Connector to an external document service. Use a plugin when you want Bubble-native page or element rendering. Use the API Connector when you need a specific provider, template engine, conversion API, or document workflow.

Start by defining the document and delivery path. An invoice might be generated after payment, saved to a database record, emailed to a customer, and made available from a private download link. A certificate might be generated from a Bubble page and downloaded immediately. Those requirements determine the best rendering model and plugin.

1. Choose the document generation model

Model Best for Trade-offs
Plain-text server-side PDF Simple invoices, receipts, letters, and reports Limited layout and font control
Bubble-page rendering Branded documents that reuse your Bubble design and live data Requires careful page sizing, visibility rules, and rendering checks
Element capture Capturing a specific group, repeating group, or document component Multi-page layouts and repeating data need testing
External document API Form filling, merging, splitting, compression, conversion, templates, or provider-specific features Adds provider authentication, cost, retention, and availability concerns

2. Install a Bubble document plugin

Marketplace options cover different rendering models:

  • pdf-generator: Builds PDFs server-side from plain text, with paper size, orientation, font size, and margins. Its checked listing states that it renders Latin-script characters with Helvetica; verify requirements before using Japanese, Chinese, Korean, Arabic, or other scripts.
  • PDF Generator for Bubble Mobile: A native mobile option advertising styled text, images, logos, QR codes, tables, watermarks, headers, footers, and completion events. Confirm current pricing and mobile-runtime compatibility before deployment.
  • SnapPDF: Renders Bubble pages server-side using Bubble data, workflows, and database records. The listing says it respects Bubble privacy settings and supports single or bulk generation.
  • PDF Creator: Captures one or more Bubble elements, supports repeating groups across pages, headers, footers, database storage, private files, email delivery, and right-to-left scripts.
  • PDF API (DO & DIE) / MyPowerly: Connects Bubble to an external PDF API for generation, form filling, merging, splitting, compression, conversion, watermarks, backend workflows, and secure storage.

Marketplace listings are vendor-authored and can change. Before deployment, verify current price, supported scripts, runtime compatibility, API limits, privacy behavior, retention, and support.

3. Build the document page in Bubble

  1. Create a dedicated page or reusable element for the document, rather than capturing a screen that contains navigation and controls.
  2. Bind text, images, line items, totals, dates, and customer details to the record being rendered.
  3. Set a fixed document width and remove responsive elements that can reflow unpredictably.
  4. Use print-friendly colors, sufficient contrast, and explicit page-break containers where the plugin supports them.
  5. Hide buttons, debug fields, menus, and interactive controls during document generation.
  6. Test long names, large tables, missing images, empty repeating groups, and multiple pages.

4. Connect an external document API with Bubble API Connector

Bubble’s API Connector sets up outbound calls from your app to a third-party system. A configured call can be used as a workflow action or a data source after initialization.

Configure the call

  1. Install the API Connector from the Plugins tab.
  2. Add a new API and choose the authentication method required by the provider: API key, header, basic auth, OAuth, JWT, or another documented scheme.
  3. Create a call with the provider’s method, URL, headers, query parameters, and JSON body.
  4. Mark secrets as private so they are not exposed to the browser.
  5. Use Bubble dynamic parameters for record IDs, template IDs, customer fields, and document data.
  6. Initialize the call with safe sample data. Bubble sends a real request during initialization and reads the response structure, so use a sandbox or non-destructive endpoint where available.
  7. After initialization, use the call as a workflow action or data source.

Example JSON request body

{
  "template_id": "invoice",
  "data": {
    "invoice_number": "INV-1042",
    "customer_name": "Ada Lovelace",
    "currency": "USD",
    "items": [
      {"description": "Consulting", "quantity": 2, "unit_price": 125}
    ],
    "total": 250
  }
}

Replace the field names with the provider’s documented schema. Do not assume that a plugin’s fields match an unrelated API.

5. Trigger generation from a Bubble workflow

  1. Choose the event: button click, payment success, database change, scheduled workflow, or backend workflow.
  2. Load the source record and validate required fields.
  3. Call the plugin action or API Connector action.
  4. Store the returned file URL, provider document ID, or job ID on the source record.
  5. Show a download link, attach the file to an email, or pass the ID to a later workflow.
  6. Display a clear processing or failure state instead of assuming the file is ready immediately.
Field Purpose
Document status Queued, processing, ready, or failed
Document URL or file Download or attachment target
Provider job ID Polling, webhook matching, and support
Generated at Audit trail and cache decisions
Error message Actionable retry and support information

6. Store, secure, and deliver the file

  • Apply Bubble privacy rules to the source record and generated file.
  • Check whether the plugin stores files in Bubble storage or returns a provider URL.
  • Confirm whether returned links are public, signed, expiring, or access-controlled.
  • Do not expose provider API keys in client-side workflows.
  • Restrict document queries by the current user, organization, or account.
  • Decide how long generated files and provider copies should be retained.
  • For email delivery, generate server-side and attach the resulting file only after the generation step succeeds.

7. Choosing between plugins and API Connector

Requirement Usually the better starting point
You need a quick text-first PDF Server-side plain-text plugin
You want to design the document as a Bubble page Page-rendering plugin such as SnapPDF
You need repeating groups, headers, footers, or RTL text Element-based plugin such as PDF Creator, after testing your layout
You need merge, split, compression, conversion, or form filling External PDF API through API Connector
You need native mobile generation Mobile PDF plugin, after confirming runtime support
You need full control over authentication and request data API Connector

8. Or skip the browser setup

If your document is already a public or authenticated Bubble page, ScreenshotNeo can capture the rendered page through one API request. It accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be disabled. Clean shots are the only billable results: bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the result with X-Page-Verdict and X-Billed headers.

See the ScreenshotNeo API documentation for PDF settings, authentication, private pages, waiting rules, and delivery options.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://yourapp.bubbleapps.io/invoice/1042 -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://yourapp.bubbleapps.io/invoice/1042"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://yourapp.bubbleapps.io/invoice/1042' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

For a private Bubble page, configure the required custom headers, cookies, user agent, or Authorization values in the request according to your access design. ScreenshotNeo also supports full-page capture, CSS element capture, dark mode, device presets, custom viewports, retina scale, custom CSS and JavaScript, selector waits, delays, network-idle waits, request blocking, image resizing, chosen cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, and PDF output.

An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Free usage includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.

9. Troubleshooting

Symptom Likely cause Fix
API call does not appear in Bubble The call was not initialized successfully Use valid sample data, initialize again, and inspect the real response.
Initialization changes production data Initialization sends a real request Use a sandbox or non-destructive endpoint and sample record.
Document is blank Data is loaded asynchronously or privacy rules deny access Wait for the record and images, test as the intended user, and verify server-side permissions.
Layout is cut off Fixed height, overflow, or an unsupported page break Use a dedicated document layout, allow content to expand, and test long records.
Repeating-group rows disappear The renderer cannot access the list or the list is outside the capture context Pass the record explicitly, verify privacy rules, and test a multi-page list.
Fonts or characters are wrong Plugin font or script limitation Confirm supported scripts and font embedding before selecting the plugin.
Images are missing Private URLs, lazy loading, or blocked resources Use accessible image URLs, wait for the image selector, and check resource permissions.
Download link exposes another user’s file Public storage or weak Bubble privacy rules Use private files or signed links and test access as another account.
External API times out Large document, slow assets, or provider limits Reduce asset size, use asynchronous jobs where supported, and record job status for retries.

10. Performance, reliability, and cost

  • Generate large or bulk documents in backend workflows so the browser does not remain open.
  • Cache immutable documents and avoid regenerating the same invoice for every download.
  • Compress oversized images before rendering.
  • Keep a provider job ID and retry only failed jobs; use idempotency controls when the provider offers them.
  • Measure generation time, failure rate, file size, and provider response codes in your own logs.
  • Compare plugin one-time or subscription pricing with external API usage charges and storage costs.
  • For sensitive documents, review provider retention, data residency, access controls, and deletion behavior before sending production data.
  • For ScreenshotNeo, cache hits and failed or unusable page results are not billed; use the response verdict and billing headers when reconciling usage.

11. Deployment checklist

  • Document template tested with short and long data.
  • Multiple pages and repeating groups verified.
  • Fonts, scripts, RTL text, logos, and images checked.
  • Privacy rules tested as owner, member, and unrelated user.
  • API keys stored privately.
  • Generation status and retry path implemented.
  • File retention and link exposure documented.
  • Email attachment and download behavior verified.
  • Provider limits and current pricing reviewed.

FAQ

Can Bubble generate a PDF without an external API?

Yes. A server-side plugin can build a PDF inside Bubble’s runtime. Other plugins render Bubble pages or elements server-side.

Should I generate documents in the browser?

Use browser generation for small, immediate downloads. Use backend workflows for invoices, scheduled jobs, bulk output, and documents that must finish when the user leaves the page.

How do I send a generated document by email?

Store the returned Bubble file, provider URL, or completed job result, then use it as the email attachment after a successful generation step.

What should I do when a plugin lacks a required feature?

Use Bubble API Connector with a provider that supports the missing operation, such as form filling, merging, conversion, or compression.

Can ScreenshotNeo create a document from Bubble data?

It captures the rendered Bubble page or produces a PDF from that page. Your Bubble page must expose the intended data to the capture request through its authentication and access configuration.