Control PDF and web page
1. API Description
This API is used to control PDF and web page.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/layer-control/scene-layer-control-action
- V2.5.0 and below: POST [ip]/mwapi/scene-layer-control-action
Administrator Rights | Logged-in |
---|---|
No | Yes |
2. Input Parameters
Name | Required | Type | Description |
---|---|---|---|
sceneId | Yes | Int | Scene ID, which can be obtained via Get scene list |
layerId | Yes | Int | Layer ID, the layer position in the layer array |
actionType | Yes | Int | Action Type Definition |
scaleMode | No | Int | Scaling mode, optional parameter, only effective during scaling control 0: Free 2: Fit content to screen (only for PDF) 3: Fit width to screen (only for PDF) |
scale | No | Int | Scaling factor, optional parameter, only effective during scaling control and in free scaling mode. Scaling factor * 10000 |
x | No | Int | Horizontal coordinate, optional parameter, only effective during touch control on the App side. The origin is at the bottom-left corner of the canvas, ranging from 0 to 1000000 |
y | No | Int | Vertical coordinate, optional parameter, only effective during touch control on the App side. The origin is at the bottom-left corner of the canvas, ranging from 0 to 1000000 |
Action Type Definition
Action Type | Definition |
---|---|
0 | No action |
1 | Touch control, finger press |
2 | Touch control, finger move |
3 | Touch control, finger release |
4 | Touch control, cancel (same effect as release) |
5 | Scaling control |
6 | Back (only effective for web pages) |
7 | Forward (only effective for web pages) |
8 | Refresh web page (only effective for web pages) |
9 | Reserved functionality |
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
message | String | Status description |
4. Example
Performing a scaling adjustment on the PDF layer within the scene identified by ID 110.
Input Example
{
"sceneId":110,
"layerId":0,
"actionType":5,
"scale":10000,
"scaleMode":2,
"x":0,
"y":0
}
Output Example
{
"status":0,
"message": "SUCCESS"
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Status | Definition | Description |
---|---|---|
7 | MW_STATUS_INVALID_ARG | Missing required parameters |