示例#1
0
        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}";
        }
示例#2
0
        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);
            }
        }