-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.vb
More file actions
27 lines (22 loc) · 1.15 KB
/
Program.vb
File metadata and controls
27 lines (22 loc) · 1.15 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
Imports DevExpress.Pdf
Imports System.Diagnostics
Namespace ExtractDocumentPages
Friend Class Program
Shared Sub Main(ByVal args As String())
Using source As PdfDocumentProcessor = New PdfDocumentProcessor()
source.LoadDocument("..\..\..\Document.pdf")
For i As Integer = 0 To source.Document.Pages.Count - 1
Using target As PdfDocumentProcessor = New PdfDocumentProcessor()
target.CreateEmptyDocument("..\..\ExtractedPage" & (i + 1).ToString() & ".pdf")
target.Document.Pages.Add(source.Document.Pages(i))
End Using
Using target1 As PdfDocumentProcessor = New PdfDocumentProcessor()
target1.CreateEmptyDocument("..\..\ExtractedFirstPage.pdf")
target1.Document.Pages.Add(source.Document.Pages(0))
End Using
Next
Process.Start(New ProcessStartInfo("explorer.exe", $"/select,""{"..\..\ExtractedFirstPage.pdf"}""") With {.UseShellExecute = True})
End Using
End Sub
End Class
End Namespace