Flatten Annotations
Annotations in a PDF document can be flattened in the ComPDFKit by calling flattenAllPages
and save
function.
// Open document from file path
CPDFDocument document = new CPDFDocument(context);
document.open(pdfPath, passwod);
// flatten all pages from document
boolean result = document.flattenAllPages(CPDFPage.PDFFlattenOption.FLAT_NORMALDISPLAY);
// save document
if (result) {
document.save();
}