Example: The following example will place an icon on the PDF that once clicked on will display text in a separate box.
import com.cete.dynamicpdf.*; import com.cete.dynamicpdf.pageelements.*; public class MyClass{ public static void main(String args[]){ // Create a PDF Document Document document = new Document(); // Create a Page and add it to the document Page page = new Page(); document.getPages().add(page); // Create a note Note note = new Note("This is my help note.", 50, 50, 150, 50, NoteType.HELP, true); // Change the color property note.setColor(RgbColor.getRed()); // Add the note to the page page.getElements().add(note); page.getElements().add(new Label(" Click on the above icon to view " + "the note.", 50, 80, 150, 72, Font.getHelveticaBold(), 18)); // Save the PDF document.draw("[Physicalpath]/MyDocument.pdf"); } }