개정판 3ad12023
issue #000: final pdf bookmark 사용자명,부서 추가
Change-Id: Id5dc0ee5176256f5775900f2a2b6b507cd79523f
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
407 | 407 |
var array = memStream.ToArray(); |
408 | 408 |
File.WriteAllBytes(dest, array); |
409 | 409 |
} |
410 |
|
|
410 |
|
|
411 | 411 |
public bool SetStampInPDF(FINAL_PDF finaldata, string testFile, MARKUP_INFO markupInfo) |
412 | 412 |
{ |
413 | 413 |
string pdfFilePath = null; |
414 |
List<MEMBER> memberlist = null; |
|
414 | 415 |
FileInfo tempFileInfo = new FileInfo(testFile); |
415 | 416 |
|
416 | 417 |
if (!Directory.Exists(_FinalPDFStorgeLocal)) |
... | ... | |
418 | 419 |
Directory.CreateDirectory(_FinalPDFStorgeLocal); |
419 | 420 |
} |
420 | 421 |
pdfFilePath = _FinalPDFStorgeLocal + @"\" + tempFileInfo.Name; |
421 |
|
|
422 |
using (CIEntities cIEntities = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(finaldata.PROJECT_NO).ToString())) |
|
423 |
{ |
|
424 |
memberlist = cIEntities.MEMBER.ToList(); |
|
425 |
} |
|
422 | 426 |
using (KCOMEntities _entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
423 | 427 |
{ |
424 | 428 |
FINAL_PDF pdfLink = _entity.FINAL_PDF.Where(data => data.ID == finaldata.ID).FirstOrDefault(); |
... | ... | |
434 | 438 |
List<Dictionary<string, object>> root = new List<Dictionary<string, object>>(); |
435 | 439 |
|
436 | 440 |
var dic = new Dictionary<string, object>(); |
437 |
MarkupDataSet.Select(d => d.PAGENUMBER).ToList().ForEach(a => |
|
438 |
{ |
|
439 |
bookmark = new Dictionary<string, object>(); |
|
440 |
bookmark.Add("Title", "Commented Page : " + a); |
|
441 |
bookmark.Add("Page", a + " Fit"); |
|
442 |
//bookmark.Add("Page", "2 /XYZ 50 500 50 50"); |
|
443 |
bookmark.Add("Action", "GoTo"); |
|
444 |
bookmark.Add("Kids", outlines); |
|
445 |
root.Add(bookmark); |
|
446 |
}); |
|
441 |
foreach (var data in MarkupDataSet) |
|
442 |
{ |
|
443 |
|
|
444 |
string userid = data.MARKUP_INFO_VERSION.MARKUP_INFO.USER_ID; |
|
445 |
|
|
446 |
var member = memberlist.Where(u => u.ID == userid).FirstOrDefault(); |
|
447 |
string username = member.NAME; |
|
448 |
string userdept = member.DEPARTMENT; |
|
449 |
bookmark = new Dictionary<string, object>(); |
|
450 |
bookmark.Add("Title", string.Format("User:{0}[{1}] Commented Page : {2}", username, userdept, data.PAGENUMBER)); |
|
451 |
bookmark.Add("Page", data.PAGENUMBER + " Fit"); |
|
452 |
bookmark.Add("Action", "GoTo"); |
|
453 |
bookmark.Add("Kids", outlines); |
|
454 |
root.Add(bookmark); |
|
455 |
} |
|
447 | 456 |
|
448 | 457 |
|
449 | 458 |
using (PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(pdfFilePath, FileMode.Create))) |
내보내기 Unified diff