-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.vb
More file actions
33 lines (29 loc) · 1.02 KB
/
Program.vb
File metadata and controls
33 lines (29 loc) · 1.02 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
Imports DevExpress.Pdf
Imports System
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Namespace pdf_custom_properties
Friend Class Program
Shared Sub Main(ByVal args() As String)
Using pdfProcessor As New PdfDocumentProcessor()
pdfProcessor.LoadDocument("PageDeletion.pdf")
ModifyCustomProperties(pdfProcessor.Document)
pdfProcessor.SaveDocument("Result.pdf")
Process.Start(New ProcessStartInfo("Result.pdf") With {.UseShellExecute = True})
End Using
End Sub
Private Shared Sub ModifyCustomProperties(ByVal document As PdfDocument)
'Add new property
document.CustomProperties.Add("NumberOfCopies", "3")
'Modify the CompanyEmail property value:
If document.CustomProperties.ContainsKey("CompanyEmail") Then
document.CustomProperties("CompanyEmail") = "clientservices@devexpress.com"
End If
'Remove the HasImages property:
document.CustomProperties.Remove("HasImages")
End Sub
End Class
End Namespace