How do users export from the embed?

Export as PNG, AVIF, PDF, HTML or MP4 directly from the embedded editor.

Updated

Users can download their designs directly from the embed in multiple formats. Turn on Allow Template Download in your embed settings. It is off by default and needs a Grow or Scale plan.

Available Formats#

FormatExtensionBest For
PNG.pngHigh-quality images with transparency
AVIF.avifSmall image files for the web
PDF.pdfPrint-ready documents
HTML.htmlWeb pages, email templates
MP4.mp4Video pages. Uses render credits

User Interface#

When downloads are enabled, users see download options in the embed toolbar:

Current Page Options#

  • Copy as PNG - Copy the current page to clipboard
  • Save as PNG - Download current page as PNG image
  • Save as AVIF - Download current page as AVIF image
  • Save as PDF - Download current page as PDF document
  • Save as HTML - Download current page as HTML file
  • Save as MP4 - Download a video page as MP4. Marked "Uses Render Credits"

All Pages Options (when template has multiple pages)#

  • Save as PNG - Download all pages as a ZIP file containing PNGs
  • Save as AVIF - Download all pages as a ZIP file containing AVIFs
  • Save as PDF - Download all pages as a single multi-page PDF
  • Save as HTML - Download all pages as a ZIP file containing HTML files

Scale Options#

Users can select the output scale for image exports:

  • 1x - Original size
  • 2x - Double resolution (recommended)
  • 3x - Triple resolution

Programmatic Downloads#

You can also handle exports through your own application using Events.

Request Content From Your Page#

  1. Keep Allow Template Download on. Content requests fail with "Downloads are disabled" when it is off
  2. Turn on Enable Events
  3. Request content programmatically from your parent page

Request Content Example#

JavaScript
const iframe = document.querySelector("iframe");

// Request PNG content
iframe.contentWindow.postMessage(
  {
    type: "orshot:request:template",
    requestId: `req-${Date.now()}`,
    format: "png", // png, avif, pdf or html
  },
  "https://orshot.com",
);

// Listen for response
window.addEventListener("message", (event) => {
  if (event.origin !== "https://orshot.com") return;

  if (event.data.type === "orshot:template:content") {
    const { content, format, mimeType, templateName } = event.data.data;

    // content is base64 data URL for images/PDF
    // or HTML string for html format
    console.log(`Received ${format} content for ${templateName}`);
  }
});

Download Events#

When users download from the embed, events are fired to your parent page (if events are enabled):

EventDescription
orshot:download:pngDownloaded or copied as PNG (single page or ZIP for multi-page)
orshot:download:avifDownloaded as AVIF (single page or ZIP for multi-page)
orshot:download:pdfDownloaded as PDF (single or multi-page)
orshot:download:htmlDownloaded as HTML (single page or ZIP for multi-page)
orshot:download:mp4A video page downloaded as MP4

Event Payload#

JavaScript
// Single page download
{
  type: "orshot:download:png",
  timestamp: "2024-01-15T10:30:00.000Z",
  data: {
    templateId: 123,
    templateName: "My Design",
    pageIndex: 0,
    scale: 2,
    content: "data:image/png;base64,..."
  }
}

// Multi-page download (ZIP or multi-page PDF)
{
  type: "orshot:download:png",
  timestamp: "2024-01-15T10:30:00.000Z",
  data: {
    action: "zip", // "zip" for PNG/AVIF/HTML, "multipage" for PDF
    templateId: 123,
    templateName: "My Design",
    pageCount: 3,
    scale: 2
  }
}

// Copy to clipboard
{
  type: "orshot:download:png",
  timestamp: "2024-01-15T10:30:00.000Z",
  data: {
    action: "clipboard",
    templateId: 123,
    templateName: "My Design",
    pageIndex: 0,
    scale: 2,
    content: "data:image/png;base64,..."
  }
}

Use Cases#

Track Downloads#

Downloads are already counted per user and per template in the built-in Analytics tab. To also send them to your own analytics tool:

JavaScript
window.addEventListener("message", (event) => {
  if (event.origin !== "https://orshot.com") return;

  if (event.data.type.startsWith("orshot:download:")) {
    const format = event.data.type.replace("orshot:download:", "");

    // Track in your analytics
    analytics.track("embed_download", {
      format,
      templateId: event.data.data.templateId,
      templateName: event.data.data.templateName,
    });
  }
});

Custom Download Flow#

Process exports through your backend:

JavaScript
window.addEventListener("message", async (event) => {
  if (event.origin !== "https://orshot.com") return;

  if (event.data.type === "orshot:template:content") {
    const { content, format, templateId } = event.data.data;

    // Send to your backend for processing
    await fetch("/api/exports", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ content, format, templateId }),
    });
  }
});

Configuration#

SettingDescription
Allow Template DownloadShow the download menu in the embed. Also needed for content requests and custom export buttons
Enable EventsReceive download events via postMessage

Both settings need a Grow or Scale plan. To export from your own page, turn on both.

Was this page helpful?

Ready to automate?

Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.

Get your API key
  • Image, PDF and video generation via API
  • Visual editor with AI and smart layouts
  • Zapier, Make, MCP and 60+ integrations
  • White-label embed for your own app
  • 100 free credits a month, no credit card required