-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (29 loc) · 1.18 KB
/
Program.cs
File metadata and controls
32 lines (29 loc) · 1.18 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
using DevExpress.Pdf;
using System.Diagnostics;
namespace ExtractDocumentPages
{
class Program
{
static void Main(string[] args)
{
using (PdfDocumentProcessor source = new PdfDocumentProcessor())
{
source.LoadDocument("..\\..\\..\\Document.pdf");
for (int i = 0; i < source.Document.Pages.Count; i++)
{
using (PdfDocumentProcessor target = new PdfDocumentProcessor())
{
target.CreateEmptyDocument("..\\..\\ExtractedPage" + (i + 1).ToString() + ".pdf");
target.Document.Pages.Add(source.Document.Pages[i]);
}
using (PdfDocumentProcessor target1 = new PdfDocumentProcessor())
{
target1.CreateEmptyDocument("..\\..\\ExtractedFirstPage.pdf");
target1.Document.Pages.Add(source.Document.Pages[0]);
}
}
Process.Start(new ProcessStartInfo("explorer.exe", $"/select,\"{"..\\..\\ExtractedFirstPage.pdf"}\"") { UseShellExecute = true });
}
}
}
}