Introduction to DuckSlide

Get started with DuckSlide, the modern API for generating PDF documents at scale

What is DuckSlide?

DuckSlide transforms static PDF templates into dynamic documents by letting you define fields that get populated with your data during generation.

The Workflow

  1. Upload Template - Design your document in any tool (Figma, Canva, InDesign) and export as PDF
  2. Define Fields - Mark dynamic areas for text, images, tables, or AI-generated content
  3. Generate via API - Call our API with your data to generate customized PDFs
Code Example
const pdf = await duckslide.presentations.generate({
  templateId: 'invoice-template',
  fields: {
    customer_name: 'Acme Corporation',
    invoice_number: 'INV-2024-001',
    amount: '$1,250.00',
  },
});

console.log(`PDF generated: ${pdf.url}`);

Why DuckSlide?

Developer-Friendly

  • Simple API - Clean, intuitive endpoints
  • Multiple SDKs - TypeScript, Python, and more
  • Great Documentation - Comprehensive guides and examples
  • Quick Setup - Generate your first PDF in under 5 minutes

Scalable

  • Automatic Scaling - Handles 1 to 1 million+ PDFs/day
  • Fast Generation - Average generation time < 2 seconds
  • Global CDN - Fast delivery worldwide
  • 99.9% Uptime - Enterprise-grade reliability

Flexible

  • Any Design Tool - Use Figma, Canva, InDesign, or any tool that exports PDF
  • AI-Powered Content - Generate dynamic text with AI prompts
  • Multiple Delivery Methods - Email, webhooks, direct download
  • Rich Field Types - Text, images, tables, charts, barcodes, QR codes

Cost-Effective

  • Usage-Based Pricing - Pay only for what you use
  • No Infrastructure - No servers to manage or scale
  • Free Tier - 100 PDFs/month free to get started

Core Concepts

Templates

Templates are PDF files with defined dynamic fields. Think of them as blueprints for your documents.

Code Example
// Upload a template
const template = await duckslide.templates.upload({
  name: 'Invoice Template',
  file: templatePDF,
  fields: [
    { name: 'invoice_number', type: 'text', required: true },
    { name: 'customer_name', type: 'text', required: true },
    { name: 'line_items', type: 'table' },
  ],
});

Fields

Fields are placeholders in your template that get replaced with actual data during generation.

Field Types:

  • Text - Any textual content
  • Image - Photos, logos, graphics
  • Table - Dynamic rows of data
  • Chart - Bar, line, pie charts
  • Barcode/QR - Generated codes
  • AI - AI-generated content

Generation

Generation is the process of creating a PDF from a template and data.

Code Example
const pdf = await duckslide.presentations.generate({
  templateId: 'template_id',
  fields: {
    /* your data */
  },
});

Quick Start

1. Sign Up

Join the waitlist to get invited to create an account

2. Get API Key

Find your API key in the dashboard under Settings → API Keys

3. Install SDK

Installation
npm install @duckslide/sdk

4. Generate Your First PDF

Code Example
import { DuckSlide } from '@duckslide/sdk';

const client = new DuckSlide({
  apiKey: process.env.DUCKSLIDE_API_KEY,
});

const pdf = await client.presentations.generate({
  templateId: 'demo-template',
  fields: {
    name: 'Your Name',
    date: new Date().toLocaleDateString(),
  },
});

console.log(`PDF ready at: ${pdf.url}`);

That's it! You've generated your first PDF.

Common Use Cases

Invoices & Receipts

Automate billing documents for your customers:

Code Example
const invoice = await duckslide.presentations.generate({
  templateId: 'invoice',
  fields: {
    invoice_number: order.invoiceNumber,
    customer: order.customer,
    items: order.items,
    total: order.total,
  },
  delivery: {
    method: 'email',
    recipients: [order.customer.email],
  },
});

Reports & Analytics

Generate data-driven reports:

Code Example
const report = await duckslide.presentations.generate({
  templateId: 'monthly-report',
  fields: {
    revenue_chart: chartData,
    metrics: analyticsMetrics,
    insights: insights,
  },
  aiPrompts: {
    summary: "Summarize this month's performance",
  },
});

Certificates & Badges

Issue completion certificates:

Code Example
const certificate = await duckslide.presentations.generate({
  templateId: 'certificate',
  fields: {
    student_name: student.name,
    course_title: course.title,
    completion_date: new Date().toLocaleDateString(),
    certificate_id: generateUniqueId(),
  },
});

Proposals & Quotes

Create personalized sales documents:

Code Example
const proposal = await duckslide.presentations.generate({
  templateId: 'proposal',
  fields: {
    company_name: prospect.company,
    contact_name: prospect.name,
  },
  aiPrompts: {
    executive_summary: `Write a compelling summary for ${prospect.company}`,
    solution_overview: 'Explain how we solve their challenges',
  },
});

Authentication

All API requests require authentication using your API key:

Code Example
// SDK (automatic)
const client = new DuckSlide({ apiKey: 'your_api_key' });

Important: Never expose your API key in client-side code or commit it to version control.

Rate Limits

DuckSlide enforces rate limits based on your plan:

PlanRate Limit
Free100 requests/day
Pro10,000 requests/day
EnterpriseCustom

Rate limit headers are included in every response:

Code Example
Bash
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9850
X-RateLimit-Reset: 1640000000