Skip to content

Commit

Permalink
feat: enable new printPage command via webdriver protocol binding (#6102
Browse files Browse the repository at this point in the history
)

Co-authored-by: zachlysobey <zlysobey@gmail.com>
Co-authored-by: Christian Bromann <github@christian-bromann.com>
  • Loading branch information
3 people committed Nov 16, 2020
1 parent edc5d13 commit 1d8c29b
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions packages/wdio-protocols/protocols/webdriver.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,74 @@
}
}
},
"/session/:sessionId/print": {
"POST": {
"command": "printPage",
"description": "The Print Page command renders the document to a paginated PDF document.",
"ref": "https://w3c.github.io/webdriver/#print-page",
"parameters": [{
"name": "orientation",
"type": "string",
"description": "page orientation. Default: `portrait`",
"required": false
}, {
"name": "scale",
"type": "number",
"description": "page scale. Default: `1`",
"required": false
}, {
"name": "background",
"type": "boolean",
"description": "page background. Default: `false`",
"required": false
}, {
"name": "width",
"type": "number",
"description": "page width in cm. Default: `21.59` from page",
"required": false
}, {
"name": "height",
"type": "number",
"description": "page height in cm. Default: `27.94` from page",
"required": false
}, {
"name": "top",
"type": "number",
"description": "page margin in cm from top margin. Default: `1`",
"required": false
}, {
"name": "bottom",
"type": "number",
"description": "page margin in cm from bottom margin. Default: `1`",
"required": false
}, {
"name": "left",
"type": "number",
"description": "page margin in cm from left margin. Default: `1`",
"required": false
}, {
"name": "right",
"type": "number",
"description": "page margin in cm from right margin. Default: `1`",
"required": false
}, {
"name": "shrinkToFit",
"type": "boolean",
"description": "shrink pdf to fit in page. Default: `true`",
"required": false
}, {
"name": "pageRanges",
"type": "object[]",
"description": "page ranges. Default `[]`",
"required": false
}],
"returns": {
"type": "string",
"name": "pdf",
"description": "The base64-encoded PDF representation of the paginated document."
}
}
},
"/session/:sessionId/frame": {
"POST": {
"command": "switchToFrame",
Expand Down

0 comments on commit 1d8c29b

Please sign in to comment.