개정판 751494ca
issue #739 PDF Export 시 가로, 세로가 맞지 않는 현상 수정
KCOM/Controls/PrintControl.xaml.cs | ||
---|---|---|
561 | 561 |
using (PdfWriter writer = PdfWriter.GetInstance(doc, fs)) |
562 | 562 |
{ |
563 | 563 |
doc.Open(); |
564 |
float height = doc.PageSize.Height; |
|
565 |
float width = doc.PageSize.Width; |
|
566 |
|
|
564 | 567 |
foreach (var item in Printimg_List) |
565 | 568 |
{ |
566 | 569 |
|
567 |
Export_img = iTextSharp.text.Image.GetInstance(item.Value, System.Drawing.Imaging.ImageFormat.Png); |
|
570 |
Export_img = iTextSharp.text.Image.GetInstance(item.Value, System.Drawing.Imaging.ImageFormat.Png); |
|
571 |
|
|
568 | 572 |
|
569 | 573 |
if (Export_img.Width > Export_img.Height) |
570 | 574 |
{ |
571 |
doc.SetPageSize(new Rectangle(doc.PageSize.Height, doc.PageSize.Width)); |
|
575 |
doc.SetPageSize(new Rectangle(height, width)); |
|
576 |
Export_img.ScaleToFit(height, width); |
|
572 | 577 |
} |
573 | 578 |
else |
574 | 579 |
{ |
575 |
doc.SetPageSize(new Rectangle(doc.PageSize.Width, doc.PageSize.Height)); |
|
580 |
doc.SetPageSize(new Rectangle(width, height)); |
|
581 |
Export_img.ScaleToFit(width, height); |
|
576 | 582 |
} |
577 |
|
|
578 |
Export_img.ScaleToFit(doc.PageSize.Width, doc.PageSize.Height); |
|
583 |
|
|
579 | 584 |
Export_img.SetAbsolutePosition(0, 0); |
580 | 585 |
|
581 | 586 |
doc.NewPage(); |
내보내기 Unified diff