Skip to content
Guides

Samples

The Samples use preset parameters and documentation to call the API of ComPDFKit PDF SDK for Java for each function without UI interaction or parameter settings. This is achieved through modular code examples. The functions include creating, getting, and deleting various types of annotations and forms, extracting text and images, encrypting and decrypting documents, adding watermarks and bates numbers, and more.

These projects not only demonstrate the best practices for each function but also provide detailed introductions. The impact of each function on PDF documents can be observed in the output directory. With the help of the Samples, you can quickly learn how to use the functions you need and apply them to your projects.

NameDescription
AnnotationPrint the annotation list information, set the annotations (including markup, note, ink, free text, circle, square, line annotations), and delete the annotations.
AnnotationImportExportExport and import annotations with an xfdf file.
InteractiveFormsPrint form list information, set up interactive forms (including text, checkbox, radio button, button, list, combo boxes and deleting forms), and fill out form information.
PDFPageManipulate PDF pages, including inserting, splitting, merging, rotating, and replacing, etc.
DocumentInfoDisplay the information of PDF files like the author, created time, etc.
EncryptSet passwords to encrypt PDFs and set document permissions. Allow decrypting PDFs.
WatermarkCreate text/image watermarks and delete watermarks.
CompareCompare the differences between two documents, providing both content comparison and overlay comparison.
FlattenFlatten PDF annotations and forms, and merge all layouts as one layout.
PDFRedactCreate redaction to remove sensitive information or private data, which cannot be viewed and searched once applied.