 |
WebElementsMappingOptions Class |
Requests that the converter track the position of specific web page elements in the generated
pdf document. Set
CssSelectors before conversion; after conversion, read the
mapped positions from
Result. Reached through
WebElementsMappingOptions.
Inheritance HierarchySystemObject
SelectPdf.UniversalWebElementsMappingOptions
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntaxpublic class WebElementsMappingOptions
Public Class WebElementsMappingOptions
The WebElementsMappingOptions type exposes the following members.
Constructors
Properties| | Name | Description |
|---|
 | CssSelectors |
Gets or sets the CSS selectors identifying the web page elements whose position in the
generated pdf document is tracked.
|
 | Result |
Gets the collection of web element mappings populated after the conversion completes, one
per element matched by CssSelectors.
|
Top
ExampleHtmlToPdf converter = new HtmlToPdf();
converter.Options.WebElementsMappingOptions.CssSelectors =
new string[] { "h1", ".logo" };
PdfDocument doc = converter.ConvertUrl("https://www.google.com");
WebElementsCollection mapped =
converter.Options.WebElementsMappingOptions.Result;
System.Console.WriteLine("Mapped elements: " + mapped.Count);
doc.Close();Dim converter As New HtmlToPdf()
converter.Options.WebElementsMappingOptions.CssSelectors =
New String() {"h1", ".logo"}
Dim doc As PdfDocument = converter.ConvertUrl("https://www.google.com")
Dim mapped As WebElementsCollection =
converter.Options.WebElementsMappingOptions.Result
System.Console.WriteLine("Mapped elements: " & mapped.Count)
doc.Close()
See Also