Custom Buttons allow you to add your own buttons to the Orshot Embed toolbar. This is perfect for building seamless integrations where you want users to "Save to App" or trigger specific workflows instead of just downloading files to their device.
You can configure custom buttons in your workspace settings under Embed Settings > Custom Buttons.

For each button, you can customize:
orshot:custom_action).There are three main categories of actions:
These actions generate the file in the browser but do not trigger a download. Instead, they send the file data (Base64) to your application via a window event. This is ideal for "Save to App" functionality.
These actions trigger a standard browser download for the user. Useful for adding quick download presets.
This action simply sends an event to your application without generating any file data. Use this for custom workflows like "Send for Approval" or opening a modal in your app.
When a user clicks a custom button, Orshot emits an event to the parent window. You can listen for this event to handle the data.
For single page renders (or PDF/HTML emits):
window.addEventListener("message", (event) => {
// Check for your specific Event Key (default: orshot:custom_action)
if (event.data.type === "orshot:custom_action") {
const {
base64, // Data URI (data:image/png;base64,...)
format, // "png", "pdf", etc.
mimeType, // "image/png"
buttonId, // ID of the button clicked
} = event.data;
console.log("Received image data", base64);
}
});For templates with multiple pages, when using Emit PNG, the structure changes to return an array of pages in the data property:
window.addEventListener("message", (event) => {
if (event.data.type === "orshot:custom_action") {
// Check if we received a multi-page array
if (event.data.data && Array.isArray(event.data.data)) {
event.data.data.forEach((page) => {
// page object: { page: 1, base64: "data:image/png;base64,..." }
console.log(`Page ${page.page}:`, page.base64);
});
} else {
// Handle single page logic
}
}
});Instead of asking users to download an image and re-upload it to your app, add a "Save" button with Emit PNG. Listen for the event, take the base64 data, and upload it directly to your server/S3 in the background.
Use Trigger Event Only to create a "Submit for Review" button. When clicked, your app can lock the editor or change the state in your database, letting the user know their design has been submitted.
If you need to process the image (e.g., convert to CMYK or add metadata), use Emit PNG to get the raw image data, then process it on your server before presenting the final file to the user.
