public void OnSaveToPDFButtonClicked() { double? additionalMaterialQuantity = _view.AdditionalMaterialQuantity; bool additionalMaterialQuantityIsGreaterThanZeroAndSmallerThanOne100 = (additionalMaterialQuantity > 0 && additionalMaterialQuantity < 100); if ((!(additionalMaterialQuantity.HasValue && additionalMaterialQuantityIsGreaterThanZeroAndSmallerThanOne100)) || !_someCountingsFinished) { MessageBox.Show("Ilość materiału dodatkowego nie jest liczba z zakresu od 0 od 100.\nUpewnij się że przeprowadzono obliczenia."); return; } int widthForA4 = (int)((float)_view.DrawPanelWidth * 0.6); int heightForA4 = (int)((float)_view.DrawPanelHeight * 0.6); Bitmap bitmap = new Bitmap(widthForA4, heightForA4); _chart = new Chart(Graphics.FromImage(bitmap), _dataConnector.GetDeLongImages(), _dataConnector.GetDeLongChartSizingData()); _chart.ResizeTo(widthForA4, heightForA4); _chart.Draw(); CountPointsAndLinesPositionAndDraw(); _dataConnector.SaveMainChartForPDF(bitmap); _chart = new Chart(Graphics.FromHwnd(_view.DrawPanelCanvas), _dataConnector.GetDeLongImages(), _dataConnector.GetDeLongChartSizingData()); _chart.ResizeTo(_view.DrawPanelWidth, _view.DrawPanelHeight); _chart.Draw(); CountPointsAndLinesPositionAndDraw(); var schaefflerDeLongMinimapForm = new SchaefflerMinimapForm(MinimapCombination.SchaefflerDeLong, _view.AdditionalMaterialQuantity.Value, true); PdfGenerator = new PDFGenerator(PdfFor.DeLong, _dataConnector.GetFirstBasisMarerialForSchaeffler(), _dataConnector.GetSecondBasisMarerialForSchaeffler(), _dataConnector.GetAdditionalMaterialForSchaeffler(), (double)_view.AdditionalMaterialQuantity, "null", "null",_view.NewMaterialMicrophaseTextBox, _view.NewMaterialFerriteQuantityTextBox, _view.NewMaterialFerriteNumberTextBox, "null", "null"); }