'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Pdf.AcroForms '' This sample shows how to find and remove existing signatures'' from a PDF that had been digitally signed.'' See the RemoveSignatureFields for code that removes any'' signature fields instead.'' The PDF used in this sample was created by TimeSheet.PublicClassRemoveSignaturesPublicFunctionCreatePDF(ByVal stream AsStream) AsIntegerDim doc = NewGcPdfDocument()Using fs AsNewFileStream(Path.Combine("Resources", "PDFs", "TimeSheet.pdf"), FileMode.Open, FileAccess.Read) doc.Load(fs) '' Fields can be children of other fields, so we use'' a recursive method to iterate through the whole tree:RemoveSignatures(doc.AcroForm.Fields) '' Done: doc.Save(stream)Return doc.Pages.CountEndUsingEndFunction SubRemoveSignatures(ByVal fields AsFieldCollection)For i = fields.Count - 1To0Step -1IfTypeOf fields(i) IsSignatureFieldThenDirectCast(fields(i), SignatureField).Value = NothingEndIfRemoveSignatures(fields(i).Children)NextEndSubEndClass