Posts

Showing posts from June, 2017

js content

Image
using NReco.PdfGenerator; using System; using System.Text; using System.IO; using System.Text.RegularExpressions; using System.Drawing.Imaging; using System.Drawing; namespace GPSConvertor { public class Program { public static void Main(string[] args) { var g = new GPSPdfGenerator(); g.GenerateToc = true; g.FileName = "test.pdf"; Regex imgSrcRegex = new Regex("img src=\"([^\"]+)\"", RegexOptions.IgnoreCase | RegexOptions.Compiled); for (var n = 0; n < 100; n++) { // fake data var htmlFragment = $"{n} "; var imgUriMatch = imgSrcRegex.Match(htmlFragment); var imgUri = imgUriMatch.Groups[1].Value; if (!string.IsNullOrEmpty(imgUri)) { using (WebClient client = new WebClient()) { var imgS…