Skip to main content

pdf Operation

Generate PDFs from HTML.

Basic Usage

operations:
  - name: generate
    operation: pdf
    config:
      html: ${render.output}
      filename: report.pdf

Configuration

config:
  html: string          # HTML content
  filename: string      # Output filename
  format: string        # A4, Letter, etc
  margin: object        # Page margins

Examples

From HTML

operations:
  - name: render
    operation: html
    config:
      template: invoice
      data:
        items: ${input.items}

  - name: generate-pdf
    operation: pdf
    config:
      html: ${render.output}
      filename: invoice-${input.id}.pdf

Store in R2

operations:
  - name: generate
    operation: pdf
    config:
      html: ${render.output}
      filename: report.pdf

  - name: upload
    operation: storage
    config:
      type: r2
      action: put
      key: reports/${input.id}.pdf
      value: ${generate.output}

Next Steps