Hello,
I am trying to add some “burn” text annotation to a PDF.
I use
WatermarkAnnotation wa = new WatermarkAnnotation
page.getAnnotations().add(wa);
TextState ts = new TextState();
ts.setForegroundColor(Color.getRed());
if (Italic && Bold)
{
ts.setFont(FontRepository.findFont(AnnotationFont, FontStyles.Bold));
}
if (!Italic && Bold)
{
ts.setFont(FontRepository.findFont(AnnotationFont, FontStyles.Bold));
}
if (Italic && !Bold)
{
ts.setFont(FontRepository.findFont(AnnotationFont, FontStyles.Italic));
}
if (!Italic && !Bold)
{
ts.setFont(FontRepository.findFont(AnnotationFont));
}
ts.setFontSize(AnnotationSize);
wa.setOpacity(1);
wa.setTextAndState(new String[] { AnnotationText }, ts);
wa.flatten();
Right now, i dont know how to also add Italic and bold together.
I have 3 possibility for my font : Arial/Times new roman/Courier.
I have com.aspose.pdf.facades.FontStyle.TimesBoldItalic or com.aspose.pdf.facades.FontStyle.CourierBoldOblique for Times new roman and courrier but i didnt find something for Arial.
Is there something i miss?
Thank you