Vertical PdfRubberStampAnnotation
Posted: Tue Sep 15, 2015 5:19 pm
Hi,
I have a seemingly simple task to write vertical annotation using a true type font from file system but I don't know how to do that.
I realized how to write a vertical annotation using a Font type font with code below, but don't get how to do that with true type font from file.
... ...
Also, is it possible to rotate vertical annotation by 180 degrees?
Can you please give me a suggestion or example code?
Thanks,
Miki
I have a seemingly simple task to write vertical annotation using a true type font from file system but I don't know how to do that.
I realized how to write a vertical annotation using a Font type font with code below, but don't get how to do that with true type font from file.
...
Code: Select all
PdfRubberStampAnnotation pdfAnnotation = new PdfRubberStampAnnotation(page);
pdfAnnotation.Rectangle = new RectangleF(0, annotationMargin, lineHeight + annotationMargin, page.MediaBox.Height - annotationMargin * 2);
...
using (PdfGraphics graphics = pdfAnnotation.CreateNormalAppearanceGraphics())
{
brush.Color = markColor;
Font font = new Font(FontFamily.GenericSansSerif, fontSize);
StringFormat strFormat = new StringFormat();
strFormat.FormatFlags = StringFormatFlags.DirectionVertical;
strFormat.Alignment = StringAlignment.Center;
graphics.DrawString(classificationText, font, brush, pdfAnnotation.Rectangle, strFormat);
}
page.Annotations = new PdfAnnotationList(_document);
page.Annotations.Add(pdfAnnotation);
Also, is it possible to rotate vertical annotation by 180 degrees?
Can you please give me a suggestion or example code?
Thanks,
Miki