개정판 9dec2e0a
issue #937: PDF의 Size의 Left,Bottom이 (0,0)이 아닐때 변환 오류 수정
Change-Id: I2b5c2cd0251d60883c093d58f2aed6ff163ba482
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
100 | 100 |
|
101 | 101 |
public Point GetPdfPointSystem(Point point) |
102 | 102 |
{ |
103 |
point = new Point(point.X + pdfSize.Left * scaleWidth, point.Y - pdfSize.Bottom * scaleHeight);
|
|
104 |
return new Point((float)(point.X / scaleWidth), pdfSize.Height - (float)(point.Y / scaleHeight));
|
|
103 |
/// 주어진 좌표를 pdf의 (Left, Top - Bottom(?)) 좌표에 맞추어 변환한다.
|
|
104 |
return new Point(pdfSize.Left + (float)(point.X / scaleWidth), pdfSize.Top - (float)(point.Y / scaleHeight) - pdfSize.Bottom);
|
|
105 | 105 |
} |
106 | 106 |
|
107 | 107 |
public double GetPdfSize(double size) |
... | ... | |
470 | 470 |
var currentPage = DocPageItem.Where(d => d.PAGE_NUMBER == markupItem.PAGENUMBER).FirstOrDefault(); |
471 | 471 |
|
472 | 472 |
mediaBox = pdfReader.GetPageSize(markupItem.PAGENUMBER); |
473 |
mediaBox = mediaBox.Rotate(); |
|
473 | 474 |
var cropBox = pdfReader.GetCropBox(markupItem.PAGENUMBER); |
474 | 475 |
|
475 |
//scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / mediaBox.Width; |
|
476 |
//scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / mediaBox.Height; |
|
477 |
|
|
478 | 476 |
//강인구 테스트 |
479 | 477 |
scaleWidth = float.Parse(currentPage.PAGE_WIDTH) / pdfSize.Width; |
480 | 478 |
scaleHeight = float.Parse(currentPage.PAGE_HEIGHT) / pdfSize.Height; |
481 | 479 |
|
482 |
if (cropBox != null && cropBox.Width < mediaBox.Width || cropBox.Height < mediaBox.Height) |
|
483 |
{ |
|
484 |
mediaBox = cropBox; |
|
485 |
} |
|
480 |
//if (cropBox != null && cropBox.Width < mediaBox.Width || cropBox.Height < mediaBox.Height)
|
|
481 |
//{
|
|
482 |
// mediaBox = cropBox;
|
|
483 |
//}
|
|
486 | 484 |
|
487 | 485 |
pdfLink.CURRENT_PAGE = markupItem.PAGENUMBER; |
488 | 486 |
_entity.SaveChanges(); |
내보내기 Unified diff