void startGenerateReport()
        {
            if (!string.IsNullOrEmpty(txtPath.Text))
            {
                document = new Document(PageSize.A3, 0, 0, 0, 0);
                document.SetPageSize(PageSize.A3.Rotate());
                document.SetMargins(0, 0, 60f, 40f);

                var tempFileName = ("E:\\report.pdf");

                fileStream = new System.IO.FileStream(tempFileName, System.IO.FileMode.Create);
                writer = iTextSharp.text.pdf.PdfWriter.GetInstance(document, fileStream);

                var logoSetting = _reportSettingRepository.GetKeyValue(Repository.Utils.ReportSettingsKeys.Logo);

                iTextEvents = new ITextEvents();

                iTextEvents.Logo = logoSetting != null ? logoSetting.Value : string.Empty;

                writer.PageEvent = iTextEvents;

                document.Open();

                var cb = writer.DirectContent;

                drawFrontPage();

                var drawGranulometryOnPDF = new DrawGranulometryOnPDF(_granulometryControl, document, progressBar1, panel1, iTextEvents);
                drawGranulometryOnPDF.DrawCompleted += drawGranulometryOnPDF_DrawCompleted;
            }
            else
            {
                MessageBox.Show("Please provide path");
            }
        }
        public DrawKrigingMapsOnPDF(Controls.KrigingSelectionControl krigingSelectionControl, Document document, ProgressBar progressbar, Panel viewPanel, ITextEvents iTextEvents)
        {
            _document = document;
            _iTextEvents = iTextEvents;

            _progressBar = progressbar;
            _viewPanel = viewPanel;
            _krigingSelectionControl = krigingSelectionControl;

            _viewPanel.ControlAdded += _viewPanel_ControlAdded;

            _backgroundWorker = new BackgroundWorker();

            _backgroundWorker.WorkerReportsProgress = true;
            _backgroundWorker.DoWork += _backgroundWorker_DoWork;
            _backgroundWorker.ProgressChanged += _backgroundWorker_ProgressChanged;
            _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted;

            _backgroundWorker.RunWorkerAsync();
        }
        public DrawCorrelationMatrixOnPDF(Document document, List<CorrelationMatrix> correlationMatrixList, ProgressBar progressbar, ITextEvents iTextEvents)
        {
            _document = document;
            _iTextEvents = iTextEvents;

            _correlationMatrixList = correlationMatrixList;
            _progressBar = progressbar;

            _backgroundWorker = new BackgroundWorker();

            _backgroundWorker.WorkerReportsProgress = true;
            _backgroundWorker.DoWork += _backgroundWorker_DoWork;
            _backgroundWorker.ProgressChanged += _backgroundWorker_ProgressChanged;
            _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted;

            _backgroundWorker.RunWorkerAsync();
        }
        public DrawGranulometryOnPDF(Controls.GranulometryControl granulometryControl, Document document, ProgressBar progressbar, Panel viewPanel, ITextEvents iTextEvents)
        {
            _document = document;
            _iTextEvents = iTextEvents;

            _progressBar = progressbar;
            _viewPanel = viewPanel;
            _granulometryControl = granulometryControl;

            _viewPanel.ControlAdded += _viewPanel_ControlAdded;

            _backgroundWorker = new BackgroundWorker();

            _backgroundWorker.WorkerReportsProgress = true;
            _backgroundWorker.DoWork += _backgroundWorker_DoWork;
            _backgroundWorker.ProgressChanged += _backgroundWorker_ProgressChanged;
            _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted;

            _backgroundWorker.RunWorkerAsync();
        }