이미지가 있습니다. itextsharp를 통해 PDF를 넣습니다. ScalePercent 또는 ScaleAbsoluteWidth 또는 ScaleAbsoluteHeight를 사용할 때 아무 효과가 없습니다. 이미지가 PDF에 렌더링 될 때 이미지는 항상 페이지에서 사용할 수있는 공간을 차지합니다 (엄청나게 커집니다).itextsharp 이미지의 크기가 조정되지 않습니다 - 대부분의 페이지를 차지합니다
여기 내 코드입니다.
var chartImage = new System.IO.MemoryStream();
Chart1.SaveImage(chartImage, ChartImageFormat.Png);
iTextSharp.text.Image imageForChart = iTextSharp.text.Image.GetInstance(chartImage.GetBuffer());
imageForChart.ScaleAbsoluteHeight(5f);
imageForChart.ScaleAbsoluteWidth(5f);
Dictionary<string, string> dictionary = new Dictionary<string, string>();
string pageTitle = "Event Recap Report";
dictionary.Add("Started", tbStartDate.Text);
dictionary.Add("Ended", tbEndDate.Text);
PDFDocument x = new PDFDocument(pageTitle, PageSize.LETTER, 15, 15, 40, 15);
x.UserName = _currentUser.FullName;
x.WritePageHeader(1, ref dictionary);
x.WriteImage(ref imageForChart);
x.WriteGrid(ref grdEventRecap);
x.WritePageFooter();
x.Finish(false);