PHP
Get started with Orshot PHP SDK
Installation
Render from template
Generate a Signed URL
Examples
base64
response format
url
response format
binary
response format
This example writes the binary image to the file og.png
Signed URL
Output
renderFromTemplate
Use this function to render an image/pdf.
argument | required | description |
---|---|---|
templateId | Yes | ID of the template (open-graph-image-1 , tweet-image-1 , beautify-screenshot-1 , ...) |
modifications | Yes | Modifications for the selected template. |
responseType | No | base64 , binary , url (Defaults to base64 ). |
responseFormat | No | png , webp , pdf , jpg , jpeg (Defaults to png ). |
For available templates and their modifications refer Orshot Templates Page
generateSignedUrl
Use this function to generate signed URL.
key | required | description |
---|---|---|
templateId | Yes | ID of the template (open-graph-image-1 , tweet-image-1 , beautify-screenshot-1 , ...) |
modifications | Yes | Modifications for the selected template. |
expiresAt | Yes | Expires at in unix timestamp (Number). |
renderType | No | images , pdfs (Defaults to images ). |
responseFormat | No | png , webp , pdf , jpg , jpeg (Defaults to png ). |