Hi,
When I apply text Padding to a PdfFreeTextAnnotation, I do not see the padding affect.
I tried it on your demo project for PdfFreeTextAnnotations and I do not see the padding affect in the demo project.
I set the padding before the annotation is built.
textAnnotation.TextPadding = new PaddingF(10, 10, 10, 10);
The TextPadding property shows the padding I added, but I do not see the padding on the annotation when I add text to it.
Is there some other property that needs to be set for this to work?
Thanks
Harlan
TextPadding property for PdfFreeTextAnnotations do not seem to have an affect.
Moderator: Alex
-
- Posts: 84
- Joined: Fri Jan 24, 2020 3:37 am
Re: TextPadding property for PdfFreeTextAnnotations do not seem to have an affect.
Hi Harlan,
The PdfFreeTextAnnotation.TextPadding property gets or sets the padding, in default user space, of text rectangle in PDF annotation rectangle.
Best regards, Alexander
The PdfFreeTextAnnotation.TextPadding property gets or sets the padding, in default user space, of text rectangle in PDF annotation rectangle.
Best regards, Alexander
-
- Posts: 84
- Joined: Fri Jan 24, 2020 3:37 am
Re: TextPadding property for PdfFreeTextAnnotations do not seem to have an affect.
Hi Alexander,
So the TextPadding property pads that annotation rectangle, and not the text?
I am trying to add text padding so there is more separation of the text from the annotation border.
Is there a way to do this?
Thanks
Harlan
So the TextPadding property pads that annotation rectangle, and not the text?
I am trying to add text padding so there is more separation of the text from the annotation border.
Is there a way to do this?
Thanks
Harlan
Re: TextPadding property for PdfFreeTextAnnotations do not seem to have an affect.
Hi Harlan,
PDF specification does not allow to specify padding for text in text annotation.
If your application needs to view annotation and does not need to edit annotation, you can do the following:
Annotation editing in Adobe or other PDF viewers will work not correctly because PDF specification does not allow to specify padding for text in text annotation.
Best regards, Alexander
PDF specification does not allow to specify padding for text in text annotation.
If your application needs to view annotation and does not need to edit annotation, you can do the following:
- Create custom appearance generator - class derived from PdfFreeTextAnnotationAppearanceGenerator class.
- Override algorithm that draws text in text annotation by overriding the
PdfFreeTextAnnotationAppearanceGenerator.DrawText method. - Use created generator as appearance generator for instance of PdfFreeTextAnnotation class.
Annotation editing in Adobe or other PDF viewers will work not correctly because PDF specification does not allow to specify padding for text in text annotation.
Best regards, Alexander