Click or drag to resize
Pdf Library for .NET

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 Hierarchy
SystemObject
  SelectPdf.UniversalWebElementsMappingOptions

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class WebElementsMappingOptions

The WebElementsMappingOptions type exposes the following members.

Constructors
 NameDescription
Public methodWebElementsMappingOptions 
Top
Properties
 NameDescription
Public propertyCssSelectors Gets or sets the CSS selectors identifying the web page elements whose position in the generated pdf document is tracked.
Public propertyResult Gets the collection of web element mappings populated after the conversion completes, one per element matched by CssSelectors.
Top
Example
HtmlToPdf 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();
See Also