HtmlWriter Constructor

Namespace
Kampute.DocToolkit.IO.Writers
Assembly
  • Kampute.DocToolkit.dll

Definition

Initializes a new instance of the HtmlWriter class.
public HtmlWriter(TextWriter writer, bool leaveOpen = false)

Parameters

writer TextWriter
The TextWriter to write the HTML content to.
leaveOpen bool optional
A value indicating whether the underlying writer should be left open when the HtmlWriter is disposed.

Exceptions

ArgumentNullException
Thrown when writer is null.

Remarks

If leaveOpen is true, the underlying TextWriter remains open after the HtmlWriter is disposed. This is useful when managing the writer externally.
To minify the generated HTML by removing unnecessary whitespace and comments, consider using an instance of HtmlMinifier as the writer.