@herve.ngounou
Thanks for your inquiry.
You can remove all annotations as well as particular annotation from PDF document. Please use following lines of code, in the if
statement of above shared code snippet, and it will delete highlighted annotation from the resultant PDF file.
// Delete all annotations from current page
//doc.getPages().get_Item(i).getAnnotations().delete();
//To delete particular annotation
doc.getPages().get_Item(i).getAnnotations().delete(doc.getPages().get_Item(i).getAnnotations().get_Item(j));
Aspose.Pdf supports PDF_X_3 and PDF_X_1A formats, and in order to convert PDF document into these formats, please use following code snippet.
Document document = new Document(dataDir + "input.pdf");
document.convert(dataDir + "Log_Conv.log", PdfFormat.PDF_X_1A, ConvertErrorAction.Delete);
document.save(dataDir + "output.pdf");
In case of any further assistance, please feel free to let us know.