-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.vb
26 lines (22 loc) · 855 Bytes
/
Program.vb
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
Imports DevExpress.Pdf
Imports System
Imports System.IO
Namespace AttachFile
Friend Class Program
Shared Sub Main(ByVal args() As String)
Using processor As New PdfDocumentProcessor()
' Load a document.
processor.LoadDocument("..\..\Document.pdf")
' Attach a file to the PDF document.
processor.AttachFile(New PdfFileAttachment() With { _
.CreationDate = Date.Now, _
.Description = "This is my attach file.", _
.FileName = "MyAttach.txt", _
.Data = File.ReadAllBytes("..\..\FileToAttach.txt") _
})
' The attached document.
processor.SaveDocument("..\..\Result.pdf")
End Using
End Sub
End Class
End Namespace