개정판 2024d8d1
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