markus / FinalService / KCOM_FinalService / ConsoleApp1 / Program.cs @ e17af42b
이력 | 보기 | 이력해설 | 다운로드 (3.94 KB)
1 |
using KCOMDataModel; |
---|---|
2 |
using KCOMDataModel.Common; |
3 |
using KCOMDataModel.DataModel; |
4 |
using System; |
5 |
using System.Collections.Generic; |
6 |
using System.IO; |
7 |
using System.Linq; |
8 |
using System.Text; |
9 |
|
10 |
namespace ConsoleApp1 |
11 |
{ |
12 |
class Program |
13 |
{ |
14 |
static void Main(string[] args) |
15 |
{ |
16 |
string PdfFilePathRoot = ""; |
17 |
string _FinalPDFStorgeLocal = ""; |
18 |
string _FinalPDFStorgeRemote = ""; |
19 |
//string outPath = @"F:\sample_out.pdf"; |
20 |
//MarkupToPDF.MarkupToPDF pdf = new MarkupToPDF.MarkupToPDF(); |
21 |
////pdf.flattenPdfFile(@"F:\sample.pdf" , ref outPath); |
22 |
|
23 |
//if(File.Exists(@"F:\sample_A.pdf")) |
24 |
//{ |
25 |
// File.Delete(@"F:\sample_A.pdf"); |
26 |
//} |
27 |
//File.Copy(@"F:\sample.pdf", @"F:\sample_A.pdf"); |
28 |
|
29 |
//var data = pdf.SetFlattingPDF(@"F:\sample_A.pdf"); |
30 |
|
31 |
|
32 |
//using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
33 |
//{ |
34 |
// var _properties = _entity.PROPERTIES.Where(pro => pro.PROPERTY == "000000"); |
35 |
|
36 |
// if (_properties.Count() > 0) |
37 |
// { |
38 |
// PdfFilePathRoot = _properties.Where(t => t.TYPE == MarkupToPDF.PropertiesType.Const_TileSorcePath).First().VALUE; |
39 |
// _FinalPDFStorgeLocal = _properties.Where(t => t.TYPE == MarkupToPDF.PropertiesType.Const_FinalPDFStorgeLocal).First().VALUE; |
40 |
// _FinalPDFStorgeRemote = _properties.Where(t => t.TYPE == MarkupToPDF.PropertiesType.Const_FinalPDFStorgeRemote).First().VALUE; |
41 |
// } |
42 |
//} |
43 |
// using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString("000000").ToString())) |
44 |
//{ |
45 |
// var _DOCINFO = _entity.DOCINFO.Where(doc => doc.ID == "e16c382e-5c33-3883-d45b-47e4f4d4c23f"); |
46 |
|
47 |
// if (_DOCINFO.Count() > 0) |
48 |
// { |
49 |
// var DocInfoItem = _DOCINFO.FirstOrDefault(); |
50 |
|
51 |
// PdfFilePathRoot = PdfFilePathRoot + @"\" + "000000" + "_Tile" + @"\" |
52 |
// + (System.Convert.ToInt64("11111111") / 100).ToString() |
53 |
// + @"\" + "11111111" + @"\"; |
54 |
// } |
55 |
//} |
56 |
|
57 |
using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
58 |
{ |
59 |
|
60 |
//FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "ngKwBgMotw8d56dea3839120d").FirstOrDefault(); |
61 |
FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "Fu6YnWN2fO8d5a43e9de1d867").FirstOrDefault(); |
62 |
//_entity.FINAL_PDF.AddObject(new FINAL_PDF |
63 |
//{ |
64 |
// ID = Guid.NewGuid().ToString(), |
65 |
// CREATE_DATETIME = DateTime.Now, |
66 |
// CREATE_USER_ID = "h2011357", |
67 |
// DOCINFO_ID = "ac77a75e-39d1-1764-eae3-cd252ddf4324", |
68 |
// DOCUMENT_ID = "11111116", |
69 |
// MARKUPINFO_ID = "LDEeSHCzVT8d56b76220a8e9e", |
70 |
// PROJECT_NO = "000000", |
71 |
// TOTAL_PAGE = 8, |
72 |
// STATUS = 0, |
73 |
// CURRENT_PAGE = 1, |
74 |
//}); |
75 |
//_entity.SaveChanges(); |
76 |
|
77 |
MarkupToPDF.MarkupToPDF pdf = new MarkupToPDF.MarkupToPDF(); |
78 |
pdf.EndFinal += Pdf_EndFinal; |
79 |
pdf.FinalMakeError += Pdf_FinalMakeError; |
80 |
//pdf.MakeFinalPDF(_entity.FINAL_PDF.FirstOrDefault()); |
81 |
pdf.MakeFinalPDF(item); |
82 |
} |
83 |
} |
84 |
|
85 |
private static void Pdf_FinalMakeError(object sender, MarkupToPDF.MakeFinalErrorArgs e) |
86 |
{ |
87 |
|
88 |
} |
89 |
|
90 |
private static void Pdf_EndFinal(object sender, MarkupToPDF.EndFinalEventArgs e) |
91 |
{ |
92 |
|
93 |
//경로 에러가 있음 "\\\\192.168.0.67\\finalpdf\\resulttmpE468.pdf" |
94 |
} |
95 |
} |
96 |
} |