forked from GowenGit/docnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (33 loc) · 1.17 KB
/
Program.cs
File metadata and controls
37 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Docnet.Core;
using System;
using System.IO;
namespace PdfToImage
{
public static class Program
{
public static void Main(string[] args)
{
if (args.Length != 3)
{
throw new ArgumentException(nameof(args));
}
using (var library = DocLib.Instance)
{
var result = new byte[0];
switch (args[2]?.ToLower().Trim() ?? "")
{
case "0":
result = ExampleOne.ConvertPageToSimpleImageWithLetterOutlines(library, args[0], int.Parse(args[1]));
break;
case "1":
result = ExampleTwo.ConvertPageToSimpleImageWithLetterOutlinesUsingScaling(library, args[0], int.Parse(args[1]));
break;
case "2":
result = ExampleThree.ConvertPageToSimpleImageWithoutTransparency(library, args[0], int.Parse(args[1]));
break;
}
File.WriteAllBytes("output.png", result);
}
}
}
}