개정판 401a87f8
kcom 호출 가능한 applicaion 추가
Change-Id: I40d5852be36504b4339fcb445df12a156e928d71
KCOM/Controls/SearchPanel.xaml.cs | ||
---|---|---|
36 | 36 |
string RegistrationKey = "193B-FD48-42F4-68E6-2D35-4C94-D07"; |
37 | 37 |
string RegistrationName = "license@doftech.co.kr"; |
38 | 38 |
Bytescout.PDFExtractor.TextExtractor extractor; |
39 |
Bytescout.PDFExtractor.OCRAnalyzer ocrAnalyzer; |
|
39 |
//Bytescout.PDFExtractor.OCRAnalyzer ocrAnalyzer;
|
|
40 | 40 |
private BackgroundWorker worker = new BackgroundWorker(); |
41 | 41 |
private bool IsCancelWork = false; |
42 | 42 |
|
... | ... | |
104 | 104 |
})); |
105 | 105 |
|
106 | 106 |
extractor.LoadDocumentFromFile(Common.ViewerDataModel.Instance.searchPDF.FullName); |
107 |
extractor.RegexSearch = true; |
|
108 |
|
|
107 | 109 |
//ocrAnalyzer.LoadDocumentFromFile(Common.ViewerDataModel.Instance.searchPDF.FullName); |
108 | 110 |
|
109 | 111 |
if (pageoption) |
... | ... | |
168 | 170 |
try |
169 | 171 |
{ |
170 | 172 |
extractor = new Bytescout.PDFExtractor.TextExtractor(RegistrationName, RegistrationKey); |
171 |
ocrAnalyzer = new Bytescout.PDFExtractor.OCRAnalyzer(RegistrationName, RegistrationKey); |
|
172 |
extractor.OCRMode = Bytescout.PDFExtractor.OCRMode.Auto;
|
|
173 |
extractor.OCRLanguage = "eng"; |
|
174 |
extractor.OCRLanguageDataFolder = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "tessdata"); |
|
173 |
//ocrAnalyzer = new Bytescout.PDFExtractor.OCRAnalyzer(RegistrationName, RegistrationKey);
|
|
174 |
extractor.OCRMode = Bytescout.PDFExtractor.OCRMode.Off;
|
|
175 |
//extractor.OCRLanguage = "eng";
|
|
176 |
//extractor.OCRLanguageDataFolder = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "tessdata");
|
|
175 | 177 |
|
176 | 178 |
extractor.OCRResolution = 300; |
177 | 179 |
|
178 |
ocrAnalyzer.OCRLanguage = "eng"; |
|
179 |
ocrAnalyzer.OCRLanguageDataFolder = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "tessdata"); |
|
180 |
//ocrAnalyzer.OCRLanguage = "eng";
|
|
181 |
//ocrAnalyzer.OCRLanguageDataFolder = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "tessdata");
|
|
180 | 182 |
|
181 | 183 |
} |
182 | 184 |
catch (Exception ex) |
... | ... | |
241 | 243 |
{ |
242 | 244 |
border_Overlap.Visibility = Visibility.Collapsed; |
243 | 245 |
Common.ViewerDataModel.Instance.searchPDF = new System.IO.FileInfo(FileFullPath); |
246 |
//OcrAnalyzer(); |
|
247 |
|
|
244 | 248 |
tbSearch.Focus(); |
245 | 249 |
} |
246 | 250 |
|
251 |
//private void OcrAnalyzer() |
|
252 |
//{ |
|
253 |
// System.Drawing.RectangleF rectangle = System.Drawing.RectangleF.Empty; |
|
254 |
|
|
255 |
// // Display analysis progress |
|
256 |
// ocrAnalyzer.ProgressChanged += (object sender, string message, double progress, ref bool cancel)=> |
|
257 |
// { |
|
258 |
// System.Diagnostics.Debug.WriteLine(message); |
|
259 |
// }; |
|
260 |
|
|
261 |
// // Load document to OCRAnalyzer |
|
262 |
// ocrAnalyzer.LoadDocumentFromFile(Common.ViewerDataModel.Instance.searchPDF.FullName); |
|
263 |
|
|
264 |
// // Set page area for analysis (optional) |
|
265 |
// ocrAnalyzer.SetExtractionArea(rectangle); |
|
266 |
|
|
267 |
// // Perform analysis and get results |
|
268 |
// Bytescout.PDFExtractor.OCRAnalysisResults analysisResults = ocrAnalyzer.AnalyzeByOCRConfidence(0); |
|
269 |
|
|
270 |
// // Now extract the text using detected OCR parameters |
|
271 |
|
|
272 |
// string outputDocument = @".\result.txt"; |
|
273 |
|
|
274 |
// // Create TextExtractor instance |
|
275 |
|
|
276 |
// // Load document to TextExtractor |
|
277 |
// extractor.LoadDocumentFromFile(Common.ViewerDataModel.Instance.searchPDF.FullName); |
|
278 |
|
|
279 |
// // Setup TextExtractor |
|
280 |
// extractor.OCRMode = Bytescout.PDFExtractor.OCRMode.TextFromImagesAndVectorsAndFonts; |
|
281 |
// extractor.OCRLanguageDataFolder = ocrAnalyzer.OCRLanguageDataFolder; |
|
282 |
// extractor.OCRLanguage = ocrAnalyzer.OCRLanguage; |
|
283 |
|
|
284 |
// // Apply analysys results to TextExtractor instance |
|
285 |
// ocrAnalyzer.ApplyResults(analysisResults, extractor); |
|
286 |
|
|
287 |
// // Set extraction area (optional) |
|
288 |
// extractor.SetExtractionArea(rectangle); |
|
289 |
|
|
290 |
// // Save extracted text to file |
|
291 |
// extractor.SaveTextToFile(outputDocument); |
|
292 |
|
|
293 |
//} |
|
294 |
|
|
247 | 295 |
private void Client_DownloadProgressChanged(object sender, System.Net.DownloadProgressChangedEventArgs e) |
248 | 296 |
{ |
249 | 297 |
tlDonwloadState.Text = "문서를 다운로드 중입니다 : " + e.ProgressPercentage; |
내보내기 Unified diff