The destination parameter specifies where your PDF will be stored when using asynchronous rendering.

Overview

When rendering PDFs asynchronously, the generated file needs to be stored somewhere. The destination parameter allows you to configure cloud storage details for the rendered PDF.

Parameter Details

destination
object
required

Configuration for where your PDF will be stored when using asynchronous rendering

Usage

{
  "parts": "https://example.com",
  "destination": {
    "provider": "aws_s3",
    "bucket": "my-pdf-bucket",
    "path": "reports/document.pdf"
  }
}

Behavior

When you submit an asynchronous rendering request with a destination, the API will:

  1. Accept your request and return immediately with a success status
  2. Process the rendering in the background
  3. Upload the completed PDF to the specified cloud destination
  4. Notify you via webhook (if configured) when the process is complete

Use Cases

This parameter is particularly useful for:

  1. Large document generation: When rendering complex or large documents that may take time to process
  2. Background processing: When you want to initiate rendering without waiting for completion
  3. Direct cloud storage: When you want PDFs delivered directly to your cloud storage without intermediary steps

The destination parameter is often used together with the webhook parameter, which allows you to receive a notification when the rendering is complete:

{
  "parts": "https://example.com",
  "destination": {
    "provider": "aws_s3",
    "bucket": "my-pdf-bucket",
    "path": "reports/document.pdf"
  },
  "webhook": {
    "url": "https://myapp.com/webhooks/pdf-complete",
    "headers": {
      "Authorization": "Bearer your-secret-token"
    }
  }
}

The webhook will receive a POST request with information about the completed rendering, including the status and location of the generated PDF.