as you can see in the following link creation (see below).
*/
int fileAttachmentPageIndex = page.getIndex();
String fileAttachmentName = "attachedSamplePDF";
String fileName = new java.io.File(filePath).getName();
FileAttachment attachment = new FileAttachment(
page,
new Rectangle(0, -20, 10, 10),
new FileSpec(
EmbeddedFile.get(
document,
filePath
),
fileName
)
);
attachment.setName(fileAttachmentName);
attachment.setText("File attachment annotation");
attachment.setIconType(FileAttachment.IconTypeEnum.PaperClip);
blockComposer.begin(new Rectangle2D.Double(30,170,200,50),AlignmentXEnum.Left,AlignmentYEnum.Middle);
composer.setFont(font,12);
blockComposer.showText("Embedded-goto link");
composer.setFont(font,8);