프로젝트

일반

사용자정보

개정판 9e1fa617

ID9e1fa617942545c5a28b61b97ee679f66950e1b3
상위 99558071
하위 2fcff2ae

GeunHo Song 이(가) 약 2년 전에 추가함

issue #000 SVG 사이즈 조정.

차이점 보기:

HYTOS/HYTOS/MainWindow.py
1640 1640
                            cal_image = openpyxl.drawing.image.Image(report_drawing_path)
1641 1641
                            x_scale = MainWindow.PAPER_SIZE.width() / cal_image.width
1642 1642
                            y_scale = MainWindow.PAPER_SIZE.height() / cal_image.height
1643
                            #cal_image.width *= x_scale
1644
                            #cal_image.height *= y_scale
1643
                            cal_image.width *= x_scale
1644
                            cal_image.height *= y_scale
1645 1645
                            ws.add_image(cal_image, 'A1')
1646 1646

  
1647 1647
                        company_image = openpyxl.drawing.image.Image(company_image_path)
......
2304 2304

  
2305 2305
                    if report_drawing == 'Use SVG':
2306 2306
                        report_app_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ReportApp', 'ReportApp.exe')
2307

  
2308
                        arguments = [report_app_path, save_file_name, report_drawing_path]
2307
                        arguments = [report_app_path,
2308
                                     save_file_name,
2309
                                     report_drawing_path,
2310
                                     f"{MainWindow.PAPER_SIZE.width()},{MainWindow.PAPER_SIZE.height()}"]
2309 2311
                        res = subprocess.call(arguments)
2310 2312
                        if res == 0:
2311 2313
                            os.startfile(save_file_name)
ReportApp/ReportApp/Program.cs
14 14
        {
15 15
            SpreadsheetInfo.SetLicense("SN-2021May25-IPYYaC5T2J/LIzFImndeajkkMS/Fn1fLWGfjRRxTNu/uan2hm9KrTK/v9hdsQfLCOuUeMZXrEHCPsmS7Pnp4YGIGsOw==A");
16 16
           
17
            if (args[0] != null && args[1] != null && args.Count() == 2)
17
            if (args.Count() == 3)
18 18
            {
19
                string ExcelPath = args[0];
20
                string SvgPath = args[1].Replace("\\", "/");
21

  
22
                if (File.Exists(ExcelPath) && File.Exists(SvgPath))
19
                if (args[0] != null && args[1] != null && args[2] != null)
23 20
                {
24
                    var workbook = ExcelFile.Load(ExcelPath);
21
                    string ExcelPath = args[0];
22
                    string SvgPath = args[1].Replace("\\", "/");
23
                    List<double> Sizes = args[2].Split(',').Select(x => double.Parse(x)).ToList();
25 24

  
26
                    foreach (var worksheet in workbook.Worksheets)
25
                    if (File.Exists(ExcelPath) && File.Exists(SvgPath))
27 26
                    {
28
                        if (worksheet.Name.Contains("Page"))
27
                        var workbook = ExcelFile.Load(ExcelPath);
28

  
29
                        foreach (var worksheet in workbook.Worksheets)
29 30
                        {
30
                            worksheet.Pictures.Add(SvgPath, "A1", 1550, 990, LengthUnit.Pixel);
31
                            if (worksheet.Name.Contains("Page"))
32
                            {
33
                                worksheet.Pictures.Add(SvgPath, "A1", Sizes[0], Sizes[1], LengthUnit.Pixel);
34
                            }
31 35
                        }
32
                    }
33
                    workbook.Save(ExcelPath);
36
                        workbook.Save(ExcelPath);
34 37

  
35
                    return 0;
38
                        return 0;
39
                    }
36 40
                }
37 41
            }
38 42

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)