프로젝트

일반

사용자정보

개정판 2024d8d1

ID2024d8d1cee1b1885e31d7357ebb3c6ba6a2bf66
상위 751494ca
하위 408e4218

이지연이(가) 약 6년 전에 추가함

issue #740 Print 미리보기 또는 출력 시 가로 페이지가 잘리는 현상 수정

차이점 보기:

KCOM/Controls/PrintControl.xaml.cs
481 481
            foreach (int PageNo in _lstPrintPageNo)
482 482
            {
483 483
                cnt++;
484
                sliderPages.Value = PageNo;
484
                sliderPages.Value = PageNo;                
485 485
                PageChanged(PageNo, true);
486 486
                //PageChanged(cnt, true);
487 487
            }
......
739 739
                printDocument.PrinterSettings.MinimumPage = 1;
740 740
                printDocument.PrinterSettings.MaximumPage = _lstPrintPageNo.Count();
741 741
                printDocument.PrinterSettings.FromPage = 1;
742
                printDocument.PrinterSettings.ToPage = _lstPrintPageNo.Count();
743

  
742
                printDocument.PrinterSettings.ToPage = _lstPrintPageNo.Count();          
743
                
744 744
                printDocument.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
745 745
                printDocument.PrinterSettings.PrinterName = PrintName;
746

  
746
                
747 747
                dlg.Document = printDocument;
748 748
                dlg.WindowState = System.Windows.Forms.FormWindowState.Maximized;
749 749
                dlg.ShowDialog();
......
767 767
        {
768 768
            //Printimg_List = new Dictionary<int, System.Drawing.Image>();
769 769
            // This demo only loads one page at a time, so no need to re-set the print page number
770
            PrintDocument document = sender as PrintDocument;
770
            PrintDocument document = sender as PrintDocument;            
771 771
            currentPage = document.PrinterSettings.FromPage;
772 772
        }
773 773

  
......
778 778
            Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate
779 779
            {
780 780
                p_img = Printimg_List.Where(data => data.Key == currentPage).FirstOrDefault().Value;
781

  
782
                if(p_img.Width > p_img.Height)
783
                {
784
                    p_img.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);
785
                }
786
                
781 787
                iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(p_img, System.Drawing.Imaging.ImageFormat.Jpeg);
782 788
                System.Drawing.Rectangle m = e.MarginBounds;
783 789

  
......
789 795
                {
790 796
                    m.Width = (int)((double)pic.Width / (double)pic.Height * (double)m.Height);
791 797
                }
792

  
798
                                
793 799
                e.Graphics.DrawImage(p_img, m);
794 800
                //e.Graphics.DrawImage(p_img, e.MarginBounds);
795 801
                //e.Graphics.DrawImage(p_img, 0, 0);

내보내기 Unified diff

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