DMD-to-PDF Plugin Setup Guide
Complete instructions for installing and using the plugin in your Bubble app.
1. Install the PluginGo to your Bubble app's Plugins tab and install the plugin
2. Configure License Keys (Optional)If you have a Pro license, add your keys in the plugin settings:
β’
client_key - Pro license key for client-side (browser) PDF generation. Enables custom fonts, watermarks, and other Pro features on the frontend.
β’
server_key - Pro license key for server-side PDF generation. Required for Pro features in backend workflows.
Note: The plugin works without license keys using the free tier. Pro features will be disabled.
Client-Side PDF Generation (Frontend)Use client-side generation for instant PDF downloads. PDFs are generated directly in the user's browser.
1. Add the Element to Your Page1. In the Design tab, search for "PDF" in the Visual Elements panel
2. Drag the element onto your page
3. The element is invisible at runtime - it only provides PDF generation functionality
Available FunctionsCreate PDFGenerates a PDF from DMD markup content.
Inputs:β’
Content (text) - The DMD markup source to convert to PDF. Required.
β’
Download (yes/no) - If Yes, the PDF downloads immediately to the user's device.
β’
Save to (text) - Your Bubble app URL (e.g.,
https://myapp.bubbleapps.io). If provided, uploads the PDF to Bubble storage.
β’
Attach to (thing) - A Bubble thing to attach the PDF as a private file. Makes the file private and linked to this thing.
Register ImagePre-loads an image so it can be referenced by name in your DMD content. Useful if you will use the same image in many places in the Document or add the same image to many documents. You can do this on page load.
Inputs:β’
Name (text) - Alias to reference this image in DMD markup (e.g., [alt]{img: name}).
β’
Image (text) - URL of the image to preload.
Register Font (Pro Only)Pre-loads a custom font for use in your documents. We recommend you do this on the event "Enabled PRO" to make sure the Pro license is enabled when you try to load a font, avoiding an error.
Inputs:β’
Name (text) - Font family name to use in DMD styles (e.g., font: MyFont).
β’
Normal (text) - URL to the regular weight TTF file. Required.
β’
Bold (text) - URL to the bold weight TTF file. Optional, falls back to normal.
β’
Italics (text) - URL to the italic TTF file. Optional, falls back to normal.
β’
Bold Italics (text) - URL to the bold-italic TTF file. Optional, falls back to bold or normal.
Element Statesβ’
PDF url (text) - The URL of the uploaded PDF in Bubble storage. Only set when "Save to" is provided.
β’
Error (text) - Error message if PDF creation or upload failed.
Element Eventsβ’
Enabled pro - Triggered when a Pro license is successfully validated on initialization.
β’
Was created - Triggered when a PDF is successfully created and uploaded to Bubble storage.
β’
Threw an error - Triggered when PDF creation or upload fails. Check the error state for details.
Server-Side PDF Generation (Backend)You can use the actions:
Create PDF,
Register Font (Pro Only) and
Register Image. They are similar to the respective actions on the frontend.
Tips & Best Practicesβ’
Use dynamic data - Insert Bubble dynamic expressions directly in your DMD content. It's just text!
β’
Test in playground first - Use
dmdlang.dev playground to design and preview your PDF before implementing in Bubble.
β’
Pre-register images - For images used repeatedly, register them once on page load for better performance.
β’
Backend for automation - Use server-side generation for scheduled reports, email attachments, and API workflows.
β’
Check for errors - Always handle the "threw_an_error" event to show users meaningful error messages.
TroubleshootingPDF not generating?β’ Check the error state on the element or the error output from server actions
β’ Verify your DMD syntax in the
playgroundCustom fonts not working?β’ Ensure you have a Pro license key configured
β’ Call Register Font BEFORE Create PDF
β’ Verify the font URL is accessible (CORS-enabled)
Images not appearing?β’ Use full URLs (https://...) for images
β’ Register images before generating the PDF
β’ Check that image URLs are publicly accessible
Need Help?β’ Documentation:
dmdlang.devβ’ Email:
[email protected]