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


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

Convert

POST /superdoc/v1/convert — Convert documents between formats

Annotate

POST /superdoc/v1/annotate — Populate DOCX template fields

Common patterns

Generate PDF from Markdown

  document_base64: Buffer.from(markdownContent).toString('base64'),
  from: 'md',
  to: 'pdf'
});

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

Populate a contract template

  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

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' }
});

Format

Style-based document generation with templates and typography control

Vault

Store and search documents with built-in vector indexing