Ejemplo n.º 1
0
        private void SendHtml(Model.EpubLoader.HtmlResult htmlResult, int position = 0, bool lastPage = false, string marker = "")
        {
            var json = new {
                Html     = htmlResult.Html,
                Images   = htmlResult.Images,
                Position = position,
                LastPage = lastPage,
                Marker   = marker,
            };

            WebView.Messages.Send("loadHtml", json);
        }
Ejemplo n.º 2
0
        public async Task <Model.EpubLoader.HtmlResult> PrepareHTML(string html, Model.Format.Ebook epub, Model.Format.File chapter)
        {
            var doc = new HtmlDocument();

            doc.LoadHtml(html);

            this.StripHtmlTags(doc);

            var images = await this.PrepareHtmlImages(doc, epub, chapter);

            var result = new Model.EpubLoader.HtmlResult {
                Html   = doc.DocumentNode.Descendants("body").First().InnerHtml,
                Images = images,
            };

            return(result);
        }