Skip to main content
SuperDoc provides document conversion and template automation. Convert between DOCX, PDF, Markdown, and HTML formats, or populate DOCX templates with dynamic data.

Quick example

import Casedev from 'casedev';

const client = new Casedev({ apiKey: 'sk_case_YOUR_API_KEY' });

// Convert Markdown to PDF
const pdf = await client.superdoc.v1.convert({
  file: markdownFile,
  from: 'md',
  to: 'pdf'
});

// Convert DOCX to PDF
const converted = await client.superdoc.v1.convert({
  file: docxFile,
  from: 'docx',
  to: 'pdf'
});

Capabilities

FeatureDescription
Format ConversionConvert between DOCX, PDF, Markdown, and HTML
Template AnnotationPopulate DOCX templates with dynamic field data
High FidelityPreserves complex formatting, tables, and styles
Multiple Input MethodsUpload files, provide URLs, or send base64-encoded content

Supported conversions

FromToUse Case
docxpdfFinalize Word documents for distribution
mddocxGenerate editable Word docs from Markdown
mdpdfCreate PDFs directly from Markdown content
htmldocxConvert web content to Word format

Endpoints

Common patterns

Generate PDF from Markdown

const report = await client.superdoc.v1.convert({
  document_base64: Buffer.from(markdownContent).toString('base64'),
  from: 'md',
  to: 'pdf'
});

// Save the PDF
fs.writeFileSync('report.pdf', report);

Populate a contract template

const contract = await client.superdoc.v1.annotate({
  document: {
    url: 'https://your-bucket.s3.amazonaws.com/templates/contract.docx'
  },
  fields: [
    { id: 'client_name', type: 'text', value: 'Acme Corporation' },
    { id: 'contract_date', type: 'date', value: '2025-01-15' },
    { id: 'contract_amount', type: 'number', value: 50000 }
  ],
  output_format: 'pdf'
});

Convert uploaded DOCX to PDF

// In a file upload handler
const pdfBuffer = await client.superdoc.v1.convert({
  file: uploadedFile,
  from: 'docx',
  to: 'pdf'
});

// Return to user or store
return new Response(pdfBuffer, {
  headers: { 'Content-Type': 'application/pdf' }
});