Skip to content

Commit 115bee0

Browse files
authored
Merge branch 'trunk' into py_selenium_manager
2 parents 4417ec5 + 5c01399 commit 115bee0

File tree

5 files changed

+32
-36
lines changed

5 files changed

+32
-36
lines changed

examples/java/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

website_and_docs/content/documentation/webdriver/interactions/print_page.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
160160
{{< /tabpane >}}
161161

162162
### ShrinkToFit
163-
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
163+
Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
164164

165165
{{< tabpane text=true >}}
166166
{{< tab header="Java" >}}

website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
160160
{{< /tabpane >}}
161161

162162
### ShrinkToFit
163-
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
163+
Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
164164

165165
{{< tabpane text=true >}}
166166
{{< tab header="Java" >}}

website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
160160
{{< /tabpane >}}
161161

162162
### ShrinkToFit
163-
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
163+
Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
164164

165165
{{< tabpane text=true >}}
166166
{{< tab header="Java" >}}

website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
---
2-
title: "Print Page"
3-
linkTitle: "Print Page"
2+
title: "打印页面"
3+
linkTitle: "打印页面"
44
weight: 7
55
aliases: [
66
"/documentation/zh-cn/support_packages/print_page/",
77
]
88
---
99

10-
Printing a webpage is a common task, whether for sharing information or maintaining archives.
11-
Selenium simplifies this process through its PrintOptions, PrintsPage, and browsingContext
12-
classes, which provide a flexible and intuitive interface for automating the printing of web pages.
13-
These classes enable you to configure printing preferences, such as page layout, margins, and scaling,
14-
ensuring that the output meets your specific requirements.
10+
无论是共享信息还是维护档案,打印网页都是一项常见任务。
11+
Selenium 通过其 PrintOptions、PrintsPage 和 browsingContext 类简化了这一过程,这些类为网页自动打印提供了灵活直观的接口。
12+
这些类使得用户可以配置打印首选项,如页面布局、页边距和缩放比例,以确保输出满足特定要求。
1513

16-
## Configuring
14+
## 配置
1715

18-
### Orientation
19-
Using the `getOrientation()` and `setOrientation()` methods, you can get/set the page orientation --- either `PORTRAIT` or `LANDSCAPE`.
16+
### 方向
17+
通过 `getOrientation()` `setOrientation()` 方法,可以获取/设置页面方向(`PORTRAIT` `LANDSCAPE`)。
2018

2119
{{< tabpane text=true >}}
2220
{{< tab header="Java" >}}
@@ -39,8 +37,8 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the
3937
{{< /tab >}}
4038
{{< /tabpane >}}
4139

42-
### Range
43-
Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the range of pages to print --- e.g. "2-4".
40+
### 范围
41+
通过 `getPageRanges()` `setPageRanges()` 方法,可以获取设置要打印页面的范围(如 "2-4")。
4442

4543
{{< tabpane text=true >}}
4644
{{< tab header="Java" >}}
@@ -63,8 +61,8 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r
6361
{{< /tab >}}
6462
{{< /tabpane >}}
6563

66-
### Size
67-
Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the paper size to print --- e.g. "A0", "A6", "Legal", "Tabloid", etc.
64+
### 尺寸
65+
通过 `getPaperSize()` `setPaperSize()` 方法,可以获取/设置要打印页面的纸张尺寸(如"A0""A6""Legal""Tabloid" 等)。
6866

6967
{{< tabpane text=true >}}
7068
{{< tab header="Java" >}}
@@ -87,8 +85,8 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap
8785
{{< /tab >}}
8886
{{< /tabpane >}}
8987

90-
### Margins
91-
Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margin sizes of the page you wish to print --- i.e. top, bottom, left, and right margins.
88+
### 边距
89+
通过 `getPageMargin()` `setPageMargin()` 方法,可以获取/设置要打印页面的边距大小(也就是上、下、左右边距)。
9290

9391
{{< tabpane text=true >}}
9492
{{< tab header="Java" >}}
@@ -111,8 +109,8 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi
111109
{{< /tab >}}
112110
{{< /tabpane >}}
113111

114-
### Scale
115-
Using `getScale()` and `setScale()` methods, you can get/set the scale of the page you wish to print --- e.g. 1.0 is 100% or default, 0.25 is 25%, etc.
112+
### 缩放
113+
通过 `getScale()` `setScale()` 方法,可以获取/设置要打印页面的缩放尺寸(如 1.0 100% 或默认缩放,0.25 25% 等)。
116114

117115
{{< tabpane text=true >}}
118116
{{< tab header="Java" >}}
@@ -135,8 +133,8 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa
135133
{{< /tab >}}
136134
{{< /tabpane >}}
137135

138-
### Background
139-
Using `getBackground()` and `setBackground()` methods, you can get/set whether background colors and images appear --- boolean `true` or `false`.
136+
### 背景
137+
通过 `getBackground()` `setBackground()` 方法,可以获取/设置背景色和图片出现,其为布尔值 `true` `false`
140138

141139
{{< tabpane text=true >}}
142140
{{< tab header="Java" >}}
@@ -159,8 +157,8 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b
159157
{{< /tab >}}
160158
{{< /tabpane >}}
161159

162-
### ShrinkToFit
163-
Using `getBackground()` and `setBackground()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`.
160+
### 缩放至合适大小
161+
通过 `getShrinkToFit()` `setShrinkToFit()` 方法,可以获取/设置页面是否会根据页面内容缩小,其为布尔值 `true` `false`
164162

165163
{{< tabpane text=true >}}
166164
{{< tab header="Java" >}}
@@ -183,19 +181,17 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t
183181
{{< /tab >}}
184182
{{< /tabpane >}}
185183

186-
## Printing
184+
## 打印
187185

188-
Once you've configured your PrintOptions, you're ready to print the page. To do this,
189-
you can invoke the print function, which generates a PDF representation of the web page.
190-
The resulting PDF can be saved to your local storage for further use or distribution.
191-
Using `PrintsPage()`, the print command will return the PDF data in base64-encoded format, which can be decoded
192-
and written to a file in your desired location, and using `BrowsingContext()` will return a String.
186+
配置好打印选项后,就可以打印页面了。为此,您可以调用打印功能,生成网页的 PDF 表示形式。
187+
生成的 PDF 文件可以保存到本地存储器中,以便进一步使用或分发。
188+
使用 `PrintsPage()` 时,打印命令将以 base64 编码格式返回 PDF
189+
数据,该格式可以解码并写入所需位置的文件,而使用 `BrowsingContext()` 时将返回字符串。
193190

194-
There may currently be multiple implementations depending on your language of choice. For example, with Java you
195-
have the ability to print using either `BrowingContext()` or `PrintsPage()`. Both take `PrintOptions()` objects as a
196-
parameter.
191+
目前可能有多种实现方式,这取决于您所选择的语言。例如,Java 可以使用 `BrowingContext()`
192+
`PrintsPage()` 进行打印。两者都将 `PrintOptions()` 对象作为一个参数。
197193

198-
Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable BiDi see [Enabling Bidi]({{< ref "bidi/" >}})
194+
注意:`BrowsingContext()` Selenium BiDi 实现的一部分。为启用 BiDi,请参见[启用 Bidi]({{< ref "bidi/" >}})
199195

200196
{{< tabpane text=true >}}
201197
{{% tab header="Java" %}}

0 commit comments

Comments
 (0)