Click or drag to resize
Pdf Library for .NET

HiddenWebElements Class

Identifies web page elements that must be hidden and not rendered in the generated pdf document. The matching elements are removed from the page layout before the conversion snapshot is taken, so neither the elements nor any links inside them appear in the output.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalHiddenWebElements

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

The HiddenWebElements type exposes the following members.

Constructors
 NameDescription
Public methodHiddenWebElements 
Top
Properties
 NameDescription
Public propertyCssSelectors Gets or sets the CSS selectors that identify the web page elements to hide. Every element matched by any selector in this array is removed from the page before conversion.
Top
Example
HtmlToPdf converter = new HtmlToPdf();
converter.Options.HiddenWebElements.CssSelectors =
    new string[] { ".cookie-banner", "#ads" };
PdfDocument doc = converter.ConvertUrl("https://www.google.com");
doc.Save("out.pdf");
doc.Close();
See Also