Skip to content

Export PNG

Base URL: https://api.dajiaoai.com

Endpoint: POST /api/render/v2

The API accepts a project payload conforming to the Dino-GSP project file protocol, renders a specified slide, and returns the exported file URL and metadata.

Size units

viewBound uses logical canvas coordinates, scale is the number of pixels per logical unit, and the returned width and height are image pixel dimensions. Visual dimensions such as font sizes and line widths in project content use px. If your source specification uses pt, see Size Units and Conversion.

See Authentication for authentication details.

Recommended for PNG exports, with support for both 2D and 3D slides.

Request headers

HeaderTypeRequiredDescription
AuthorizationstringyesBearer API key in the form Bearer <API_KEY>; no default.
Content-TypestringyesSet to application/json.
x-request-idstringnoBusiness request ID; a UUID is generated if omitted.

Request body

Rendering mode

view2D and view3D are mutually exclusive and cannot be provided together. When both are omitted, the selected slide's saved camera mode and parameters are used.

All numeric parameters must be finite.

FieldTypeRequiredDescription
contentFileContentLatestyesComplete project to render; no default. See the project file protocol.
slideIndexnumbernoTarget slide index, a positive integer starting at 1; defaults to 1.
templateobjectnoRender template; if omitted, uses the target slide's existing styles. Download template data.
view2DobjectnoOverrides the 2D viewport. See 2D viewport parameters.
view3DobjectnoForces 3D rendering and overrides camera parameters. See 3D view parameters.

view2D: 2D viewport

When view2D is provided, all four bounds are required and have no defaults. They must satisfy left < right and bottom < top.

FieldTypeDefault / RequiredDescription
leftnumberRequiredLeft bound in logical coordinates.
rightnumberRequiredRight bound in logical coordinates.
bottomnumberRequiredBottom bound in logical coordinates.
topnumberRequiredTop bound in logical coordinates.
scalenumberSaved camera valuePixels per logical unit; must be greater than 0.
pixelRationumber1Output pixel ratio; must be greater than 0.

pixelRatio scales the physical PNG dimensions without changing the logical viewport or camera scale. When omitted, scale uses the target slide's saved camera scale.

view3D: 3D view

Providing view3D forces 3D rendering. All properties in this object are optional.

Parameters marked "Saved camera value" use the target slide's saved 3D camera values when omitted.

FieldTypeDefaultDescription
offset[number, number, number]Saved camera valueCamera center with three coordinate components.
yawnumberSaved camera valueHorizontal viewing angle in radians.
pitchnumberSaved camera valueVertical viewing angle in radians.
projectionstringSaved camera valueProjection mode: orthographic (orthographic projection), perspective (perspective projection), or oblique (oblique projection).
obliqueAnglenumberSaved camera valueOblique projection direction angle in radians.
obliqueScaleRationumberSaved camera valueForeshortening ratio for the receding axis in oblique projection; must be greater than or equal to 0.
scalenumberSaved camera valueCamera scale; must be greater than 0.
widthnumber1024Logical output width; must be a positive integer.
heightnumber1024Logical output height; must be a positive integer.
pixelRationumber1Output pixel ratio; must be greater than 0.

Physical PNG dimensions = logical output dimensions × pixelRatio. For example, width: 1280, height: 720, and pixelRatio: 2 produce an image of 2560 × 1440 pixels.

Request examples

Save a complete project exported from the website or SDK as project.algeo. These examples use jq to wrap the project as content. The 3D example requires slide 1 to be a 3D slide.

Render using the saved camera:

bash
jq '{content: ., slideIndex: 1}' project.algeo | \
  curl -X POST https://api.dajiaoai.com/api/render/v2 \
    -H "Authorization: Bearer djo_xxx" \
    -H "Content-Type: application/json" \
    --data-binary @-

Override the 2D viewport:

bash
jq '{
  content: .,
  slideIndex: 1,
  view2D: {
    left: -10,
    right: 10,
    bottom: -10,
    top: 10,
    scale: 50,
    pixelRatio: 1
  }
}' project.algeo | \
  curl -X POST https://api.dajiaoai.com/api/render/v2 \
    -H "Authorization: Bearer djo_xxx" \
    -H "Content-Type: application/json" \
    --data-binary @-

Override the 3D view:

bash
jq '{
  content: .,
  slideIndex: 1,
  view3D: {
    width: 1280,
    height: 720,
    pixelRatio: 1,
    projection: "orthographic",
    yaw: 0.7853981633974483,
    pitch: 0.7853981633974483
  }
}' project.algeo | \
  curl -X POST https://api.dajiaoai.com/api/render/v2 \
    -H "Authorization: Bearer djo_xxx" \
    -H "Content-Type: application/json" \
    --data-binary @-

Success response

A successful 2D render returns 200 OK. For the explicit 2D viewport example above:

json
{
  "success": true,
  "url": "https://dl.easeplay.vip/dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.png",
  "filename": "4fa2bc.png",
  "objectKey": "dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.png",
  "slideIndex": 1,
  "viewBound": {
    "left": -10,
    "right": 10,
    "bottom": -10,
    "top": 10
  },
  "width": 1000,
  "height": 1000,
  "scale": 50,
  "mimeType": "image/png",
  "size": 24831
}

A successful 3D render also returns 200 OK, with the actual camera parameters and pixelRatio instead of the 2D viewBound and scale fields:

json
{
  "success": true,
  "url": "https://dl.easeplay.vip/dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.png",
  "filename": "4fa2bc.png",
  "objectKey": "dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.png",
  "slideIndex": 1,
  "width": 1280,
  "height": 720,
  "pixelRatio": 1,
  "camera": {
    "offset": [0, 0, 0],
    "yaw": 0.7853981633974483,
    "pitch": 0.7853981633974483,
    "projection": "orthographic",
    "obliqueAngle": 0.7853981633974483,
    "obliqueScaleRatio": 0.5,
    "scale": 0.1
  },
  "mimeType": "image/png",
  "size": 24831
}

width and height in the response are the final physical PNG dimensions; view3D.width and view3D.height specify logical output dimensions, multiplied by view3D.pixelRatio for physical output.

For existing /api/render integrations, see the legacy endpoint and migration guide.

Error responses

See render error responses.