Skip to content

Commit 471ab75

Browse files
committed
Add ISupportsPrint interface to .NET to allow use of Print method
1 parent fa6e369 commit 471ab75

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// <copyright file="ISupportsPrint.cs" company="WebDriver Committers">
2+
// Licensed to the Software Freedom Conservancy (SFC) under one
3+
// or more contributor license agreements. See the NOTICE file
4+
// distributed with this work for additional information
5+
// regarding copyright ownership. The SFC licenses this file
6+
// to you under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
// </copyright>
18+
19+
namespace OpenQA.Selenium
20+
{
21+
/// <summary>
22+
/// Interface allowing a driver implementation to generate a print representation of the page.
23+
/// </summary>
24+
public interface ISupportsPrint
25+
{
26+
/// <summary>
27+
/// Gets a <see cref="PrintDocument"/> object representing a PDF-formatted print representation of the page.
28+
/// </summary>
29+
/// <param name="printOptions">A <see cref="PrintOptions"/> object describing the options of the printed document.</param>
30+
/// <returns>The <see cref="PrintDocument"/> object containing the PDF-formatted print representation of the page.</returns>
31+
PrintDocument Print(PrintOptions options);
32+
}
33+
}

dotnet/src/webdriver/Remote/RemoteWebDriver.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace OpenQA.Selenium.Remote
6161
/// }
6262
/// </code>
6363
/// </example>
64-
public class RemoteWebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, IFindsElement, ITakesScreenshot, IHasCapabilities, IActionExecutor, IHasCommandExecutor, IAllowsFileDetection, IHasSessionId, IHasWebStorage, IHasLocationContext, IHasApplicationCache, IFindsById, IFindsByClassName, IFindsByLinkText, IFindsByName, IFindsByTagName, IFindsByXPath, IFindsByPartialLinkText, IFindsByCssSelector
64+
public class RemoteWebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, IFindsElement, ITakesScreenshot, ISupportsPrint, IActionExecutor, IHasCapabilities, IHasCommandExecutor, IAllowsFileDetection, IHasSessionId, IHasWebStorage, IHasLocationContext, IHasApplicationCache, IFindsById, IFindsByClassName, IFindsByLinkText, IFindsByName, IFindsByTagName, IFindsByXPath, IFindsByPartialLinkText, IFindsByCssSelector
6565
{
6666
/// <summary>
6767
/// The default command timeout for HTTP requests in a RemoteWebDriver instance.
@@ -842,10 +842,10 @@ public Screenshot GetScreenshot()
842842
}
843843

844844
/// <summary>
845-
/// Gets a
845+
/// Gets a <see cref="PrintDocument"/> object representing a PDF-formatted print representation of the page.
846846
/// </summary>
847-
/// <param name="printOptions"></param>
848-
/// <returns></returns>
847+
/// <param name="printOptions">A <see cref="PrintOptions"/> object describing the options of the printed document.</param>
848+
/// <returns>The <see cref="PrintDocument"/> object containing the PDF-formatted print representation of the page.</returns>
849849
public PrintDocument Print(PrintOptions printOptions)
850850
{
851851
Response commandResponse = this.Execute(DriverCommand.Print, printOptions.ToDictionary());

0 commit comments

Comments
 (0)