PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
The steps to edit an annotation are as follows:
This example shows how to edit annotations:
CPDFPage page = document.pageAtIndex(0);
List<CPDFAnnotation> annotations = page.getAnnotations();
if (annotations != null && annotations.size() > 0) {
CPDFAnnotation annotation = annotations.get(0);
if (annotation.getType() == CPDFAnnotation.Type.FREETEXT) {
CPDFFreetextAnnotation freetextAnnotation = (CPDFFreetextAnnotation) annotation;
CPDFTextAttribute textAttribute = new CPDFTextAttribute("fontname", 20, Color.YELLOW.getRGB());
freetextAnnotation.setFreetextDa(textAttribute);
freetextAnnotation.updateAp();
}
}