Exemplo n.º 1
0
        public Core(IConfiguration configuration, string sheet,
                    string img64, string html)
        {
            if (sheet == null)
            {
                throw new Exception("Planilha não preenchida!");
            }

            _configuration = configuration;
            sheetReader    = new SheetReader(sheet);

            //remove o desnecessario para transformar em bytes
            //-> "data:image/jpeg;base64," (23 caracteres)
            img = Image.GetInstance(Convert.FromBase64String(img64.Remove(0, 23)));
            img.SetAbsolutePosition(0, 0);
            img.ScaleAbsolute(PageSize.A4.Height, PageSize.A4.Width);
            img.Alignment = Image.UNDERLYING;

            this.html = html;

            se = new SendEmail(_configuration);

            generatorPDF = new GeneratorPDF(sheetReader, img, html);
        }
Exemplo n.º 2
0
 public GeneratorPDF(SheetReader sheetReader, Image img, string html)
 {
     this.sheetReader = sheetReader;
     this.html        = html;
     this.img         = img;
 }