'' This code is part of GrapeCity Documents for PDF samples.
'' Copyright (c) GrapeCity, Inc. All rights reserved.
'' This sample shows how to find and remove signature fields from a PDF.
'' The code in this sample is almost identical to the code in RemoveSignatures,
'' which also finds all signature fields, but removes just the signatures,
'' leaving the fields.
'' The PDF used in this sample was created by TimeSheet.
Public Class RemoveSignatureFields
Public Function CreatePDF(ByVal stream As Stream) As Integer
Dim doc = New GcPdfDocument()
Using fs As New FileStream(Path.Combine("Resources", "PDFs", "TimeSheet.pdf"), FileMode.Open, FileAccess.Read)
'' Fields can be children of other fields, so we use
'' a recursive method to iterate through the whole tree:
Sub RemoveSignatureFields(ByVal fields As FieldCollection)
For i = fields.Count - 1 To 0 Step -1
If TypeOf fields(i) Is SignatureField Then