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

view2D bounds use 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

content is required. view2D and view3D are mutually exclusive. The service selects 2D or 3D rendering from the target slide and reads the corresponding view parameters. These parameters do not switch the slide type. When omitted, the fixed view or protocol defaults 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.
transparentbooleannoWhether to skip the background-color fill; defaults to false.
pixelRationumbernoOutput pixel ratio; greater than 0, defaults to 1
view2DobjectnoOverrides the 2D viewport. See 2D viewport parameters.
view3DobjectnoOverrides the view parameters for a 3D slide. See 3D view parameters.

view2D: 2D viewport ​

The four bounds may all be omitted. If any bound is provided, all four are required and must satisfy left < right and bottom < top. Explicit bounds take priority over the slide’s fixed bounds, then protocol defaults; the editing camera is not inherited.

FieldTypeDefault / RequiredDescription
leftnumberAll four or noneLeft bound in logical coordinates.
rightnumberAll four or noneRight bound in logical coordinates.
bottomnumberAll four or noneBottom bound in logical coordinates.
topnumberAll four or noneTop bound in logical coordinates.
scalenumberFixed bounds scale, then 50Pixels per logical unit; must be greater than 0.
pixelRationumberTop-level value, then 1Compatibility parameter; greater than 0, takes priority over top-level pixelRatio.

pixelRatio scales the physical PNG dimensions without changing the logical viewport or camera scale. scale uses the explicit value, fixed bounds scale, then 50. view2D may contain only scale or pixelRatio, or be empty.

When neither explicit bounds nor fixed bounds are available, both X and Y default to [-10.24, 10.24]. With default scale: 50 and pixelRatio: 1, the output is 1024 × 1024 pixels. Overriding only scale does not change these default logical bounds.

view3D: 3D view ​

For a 3D target slide, view3D overrides its export view. All properties are optional.

Each field uses the explicit value, then the enabled fixed 3D view, then the protocol default listed below. Request angles are in degrees; response camera angles remain in radians.

FieldTypeDefaultDescription
offset[number, number, number][0, 0, 0]World coordinates of the view center.
yawDegnumber45Horizontal viewing angle in degrees.
pitchDegnumber45Vertical viewing angle in degrees.
projectionstringorthographicorthographic, perspective, or oblique.
obliqueAngleDegnumber45Oblique projection direction angle in degrees.
obliqueScaleRationumber0.5Receding-axis ratio; greater than or equal to 0.
scalenumber0.1Camera scale; greater than 0.
widthinteger1920Full logical viewport width; positive integer.
heightinteger1080Full logical viewport height; positive integer.
cropobjectNo croppingCrop rectangle; see below. An enabled fixed-view crop is inherited when omitted.
pixelRationumberTop-level value, then 1Compatibility parameter; greater than 0, takes priority over top-level pixelRatio.

crop uses logical viewport coordinates with the origin at the top left. All four fields are required: left, top, right, and bottom. They must satisfy 0 <= left < right <= width and 0 <= top < bottom <= height. The full viewport is rendered before cropping; cropping does not change the camera framing.

Without cropping, physical PNG dimensions = full logical viewport dimensions × effective pixelRatio. For example, width: 960, height: 540, and top-level pixelRatio: 2 produce 1920 × 1080 pixels. With cropping, the output dimensions are (right - left) × pixelRatio and (bottom - top) × pixelRatio.

PNG size limit

For both 2D and 3D exports, the final physical PNG width and height must each be at most 2048 pixels. For 3D exports with cropping, this limit applies to the cropped physical output, not the full logical viewport.

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 target slide type and its fixed view or protocol defaults:

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,
  pixelRatio: 1,
  view2D: {
    left: -10,
    right: 10,
    bottom: -10,
    top: 10,
    scale: 50
  }
}' 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,
  pixelRatio: 1,
  view3D: {
    width: 1280,
    height: 720,
    projection: "orthographic",
    yawDeg: 45,
    pitchDeg: 45
  }
}' 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,
  "pixelRatio": 1,
  "mimeType": "image/png",
  "size": 24831
}

Both 2D and 3D responses include the effective pixelRatio. A successful 3D render also returns 200 OK, with the actual camera parameters 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
}

Response width and height are the final physical PNG dimensions after any cropping. Request view3D.width and view3D.height describe the full logical viewport. The effective pixel ratio is view3D.pixelRatio, then top-level pixelRatio, then 1. Response camera.yaw, camera.pitch, and camera.obliqueAngle remain in radians.

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

Error responses ​

HTTP statusCondition
400Both view2D and view3D are provided, or a field fails schema validation (for example, crop: null).
422 / RENDER_INVALID_REQUESTView type does not match the target slide, resolved bounds or crop are invalid, or the final physical PNG width or height exceeds 2048.

See render error responses.