private string CreatePdf(SiteBase s, Dictionary <string, Dictionary <string, JOffer> > offerMap) { PdfBuilder pdf = new PdfBuilder(s); pdf.CreateHeaders(); foreach (string link in offerMap.Keys.ToList()) { Dictionary <string, JOffer> map = offerMap[link]; List <JOffer> offers = new List <JOffer>(); if (map.Count > 0) { foreach (Category item in Const.categories) { if ((map.ContainsKey(item.Name)) && (map[item.Name] != null)) { map[item.Name].SetSiteName(link); offers.Add(map[item.Name]); } else { offers.Add(new JOffer()); } } } pdf.addRow(offers.ToArray()); } pdf.Close(); return(pdf.fileName); }