프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / FileDownloadTest / Program.cs @ d33ef543

이력 | 보기 | 이력해설 | 다운로드 (1.98 KB)

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

    
7
namespace FileDownloadTest
8
{
9
    class Program
10
    {
11
        static void Main(string[] args)
12
        {
13
            //Markus.Library.Installer.Install(ArchitectureType.x64);
14

    
15
            while (true)
16
            {
17
                try
18
                {
19

    
20
                    Markus.Service.Convert.ConvertService convertService = new Markus.Service.Convert.ConvertService();
21
                    var saveitem = new Markus.Message.SaveItem
22
                    {
23
                        PdfFilePath = @"http://www.devdoftech.co.kr:5100/Doc_Manager/000000_app/VPCS_DOCLIB/40000053/250page.pdf",
24
                        SavePath = @"D:\TileSorceStorage"
25
                    };
26

    
27
                    var task = convertService.DownloadFileAsync(saveitem);
28

    
29
                    task.Wait();
30

    
31
                    if (task.Result)
32
                    {
33
                        for (int j = 0; j < 3; j++)
34
                        {
35
                            Markus.MarkusPDF markusPDF = new Markus.MarkusPDF();
36

    
37
                            markusPDF.pdfLoad(saveitem.PdfFilePath, -1, 450);
38
                            Console.WriteLine("pdf page : " + markusPDF.PageCount());
39

    
40
                            for (int i = 1; i < 20; i++)
41
                            {
42
                                var msg = markusPDF.SavePage(i, $"D:\\TileSorceStorage\\test\\{i}.png");
43
                                Console.WriteLine($"loop : {j}  page no : {i} {msg.Message}  {((Markus.Message.StatusCodeType)msg.StatusCode).ToString()}");
44

    
45
                            }
46

    
47
                            markusPDF.Dispose();
48
                           // System.Threading.Thread.SpinWait(5);
49
                        }
50
                    }
51
                }
52
                catch (Exception ex) 
53
                {
54
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
55
                }
56
            }
57
        }
58
    }
59
}
클립보드 이미지 추가 (최대 크기: 500 MB)