Hi,
Hi Vit,
Thanks for your inquiry. You may use DefaultAppearance object to set custom font for a annotation. Please check following code snippet for the purpose. Hopefully it will help you to accomplish the task.
// create an instance of font object and try loading ComicSansMS font from system font repository
com.aspose.pdf.Font font = com.aspose.pdf.FontRepository. findFont("ComicSansMS");
DefaultAppearance default_appearance = new DefaultAppearance( font, 12, java.awt.Color.BLACK );
// Create Free Text annotation
com.aspose.pdf.FreeTextAnnotation textAnnotation = new com.aspose.pdf.FreeTextAnnotation(document.getPages().get_Item(1),
new com.aspose.pdf.Rectangle(100, 100, 300, 300),default_appearance);
Best Regards,
Hi Tilal,
Hi Vit,
Hi Vit,