개정판 e3a15e22
#639 Export PDF Modify
KCOM/Controls/PrintControl.xaml.cs | ||
---|---|---|
21 | 21 |
using IKCOM; |
22 | 22 |
using iTextSharp.text.pdf; |
23 | 23 |
using Microsoft.Office.Core; |
24 |
//강인구 추가 |
|
24 |
|
|
25 | 25 |
namespace KCOM.Control |
26 | 26 |
{ |
27 |
//문서 정보 모음 클래스? |
|
28 | 27 |
public class DefinedPages |
29 | 28 |
{ |
30 | 29 |
public int PagesCount { get; set; } |
... | ... | |
564 | 563 |
doc.Open(); |
565 | 564 |
foreach (var item in Printimg_List) |
566 | 565 |
{ |
566 |
|
|
567 | 567 |
Export_img = iTextSharp.text.Image.GetInstance(item.Value, System.Drawing.Imaging.ImageFormat.Png); |
568 |
Export_img.SetAbsolutePosition(0, 0); |
|
569 |
|
|
568 |
|
|
569 |
if (Export_img.Width > Export_img.Height) |
|
570 |
{ |
|
571 |
doc.SetPageSize(new Rectangle(doc.PageSize.Height, doc.PageSize.Width)); |
|
572 |
} |
|
573 |
else |
|
574 |
{ |
|
575 |
doc.SetPageSize(new Rectangle(doc.PageSize.Width, doc.PageSize.Height)); |
|
576 |
} |
|
577 |
|
|
570 | 578 |
Export_img.ScaleToFit(doc.PageSize.Width, doc.PageSize.Height); |
579 |
Export_img.SetAbsolutePosition(0, 0); |
|
571 | 580 |
|
572 | 581 |
doc.NewPage(); |
573 | 582 |
doc.Add(Export_img); |
KCOM/Events/Export.cs | ||
---|---|---|
152 | 152 |
|
153 | 153 |
using (Graphics gr = Graphics.FromImage(Resultimg)) |
154 | 154 |
{ |
155 |
gr.DrawImage(myImage, new System.Drawing.Point(0, 0));
|
|
155 |
gr.DrawImage(myImage, new Rectangle(0,0,img.Width,img.Height));
|
|
156 | 156 |
} |
157 | 157 |
|
158 | 158 |
//image = RasterImageConverter.ConvertFromImage(Resultimg, ConvertFromImageOptions.None); |
내보내기 Unified diff