-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.vb
32 lines (28 loc) · 1.35 KB
/
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
27
28
29
30
31
32
Imports DevExpress.Pdf
Imports System
Namespace FlattenInteractiveForm
Friend Class Program
Shared Sub Main(ByVal args As String())
Using processor As PdfDocumentProcessor = New PdfDocumentProcessor()
' Load a document with an interactive form.
processor.LoadDocument("..\..\..\Document.pdf")
' Flatten a form field by its name
If processor.FlattenFormField("Nationality") Then
' Save a document with the flattened form field.
' Show a message if the form field was not found in a document.
processor.SaveDocument("..\..\..\Result1.pdf")
Else
Console.WriteLine("A document does not contain a form field with the specified name to be flattened.")
End If
' Flatten a whole interactive form.
If processor.FlattenForm() Then
' Save a document with the flattened form.
' Show a message if the interactive was not found in a document.
processor.SaveDocument("...\..\..\Result2.pdf")
Else
Console.WriteLine("A document does not contain an interactive form to flatten.")
End If
End Using
End Sub
End Class
End Namespace