public PrintItem(PrintOptions options, HtmlNode htmlNode) { _options = options; Bold = htmlNode.Bold(false); Italic = htmlNode.Italic(false); Underline = htmlNode.Underline(false); FontSize = htmlNode.FontSize(FontSize.Normal); FontType = htmlNode.FontType(); Content = $"{htmlNode.Content(TableWidth)}{Environment.NewLine}"; }
public PrintCollection(PrintOptions options, string html) { Options = options; var htmlDocument = new HtmlDocument(); htmlDocument.LoadHtml(html); foreach (var htmlNode in htmlDocument.DocumentNode.SelectNodes(".//table | .//p | .//br | .//bar-code | .//hr")) { Add(htmlNode); } }