Click or drag to resize
Pdf Library for .NET

WebElement Class

Represents the mapping of a HTML element in the PDF document as a collection of PDF rectangles. A HTML element can span on many pages in the generated PDF document and therefore, in general, many PDF rectangles are necessary to completely describe the mapping of a HTML element in PDF. Instances are produced by the conversion and obtained from Result.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalWebElement

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

The WebElement type exposes the following members.

Properties
 NameDescription
Public propertyHtmlElementCssClassName The CSS class name of the HTML element.
Public propertyHtmlElementId The ID in HTML of the HTML element.
Public propertyHtmlElementOuterHtml The HTML code of the HTML element.
Public propertyHtmlElementTagName The HTML tag name of the HTML element.
Public propertyHtmlElementText The text of the HTML element.
Public propertyPdfRectangles The rectangles occupied by the HTML element in the generated PDF document.
Top
Example
HtmlToPdf converter = new HtmlToPdf();
converter.Options.WebElementsMappingOptions.CssSelectors = new string[] { "h1" };
PdfDocument doc = converter.ConvertUrl("https://www.google.com");
WebElement element = converter.Options.WebElementsMappingOptions.Result[0];
System.Console.WriteLine(element.HtmlElementText);
doc.Close();
See Also