'''' 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 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.PublicClassRemoveSignatureFieldsPublicFunctionCreatePDF(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:RemoveSignatureFields(doc.AcroForm.Fields) '' Done: doc.Save(stream)Return doc.Pages.CountEndUsingEndFunction SubRemoveSignatureFields(ByVal fields AsFieldCollection)For i = fields.Count - 1To0Step -1RemoveSignatureFields(fields(i).Children)IfTypeOf fields(i) IsSignatureFieldThen fields.RemoveAt(i)EndIfNextEndSubEndClass