public static void RemoveHiddenData() { try { //ExStart:RemoveHiddenDataPdfFormat // initialize Pdfformat PdfFormat pdfFormat = new PdfFormat(Common.MapSourceFilePath(filePath)); // inspect document PdfInspectionResult inspectionResult = pdfFormat.InspectDocument(); // get annotations PdfAnnotation[] annotation = inspectionResult.Annotations; // if annotations are presented if (annotation.Length > 0) { // remove all annotation pdfFormat.RemoveHiddenData(new PdfInspectionOptions(PdfInspectorOptionsEnum.Annotations)); //save output file... pdfFormat.Save(Common.MapDestinationFilePath(filePath)); } //ExEnd:RemoveHiddenDataPdfFormat } catch (Exception exp) { Console.WriteLine(exp.Message); } }