# Freetext Annotation Text padding

**URL:** <https://pdfjs.community/t/freetext-annotation-text-padding/315>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [October 6, 2020, 6:13am UTC](https://pdfjs.community/t/freetext-annotation-text-padding/315 "2020-10-06T06:13:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eul.noh](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@eul.noh](https://pdfjs.community/u/eul.noh)\
**Post date:** [October 6, 2020, 6:13am UTC](https://pdfjs.community/t/freetext-annotation-text-padding/315/1 "2020-10-06T06:13:23Z")

</div>

How do I put Freetext Annotation text padding?

**PDF.js Express Version**  
7.1.0

**Detailed description of issue**  
There is an issue where the top of the text is cut off.  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/72b803e1e2bd8af8f4813c5cd031ceed4f39a09d.png)

**Expected behaviour**  
I want the text to be padded at the top so that the text is not cut off.

**Code snippet**  
newAnnot.Width = 100;  
newAnnot.Height = 30;  
newAnnot.X = 10;  
newAnnot.Y = 10;  
newAnnot.FontSize = ‘20pt’;  
newAnnot.TextColor = new Annotations.Color(0, 0, 0);  
newAnnot.setPadding(new Annotations.Rect(0, 0, 0, 0));  
newAnnot.StrokeThickness = 0;  
newAnnot.setContents(‘Textrtrtr테스트중입니다.’);  
annotManager.addAnnotation(newAnnot, true);  
annotManager.redrawAnnotation(newAnnot);

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [October 7, 2020, 2:37pm UTC](https://pdfjs.community/t/freetext-annotation-text-padding/315/2 "2020-10-07T14:37:57Z")

</div>

Hi!

You can change the values in ‘setPadding’ to add padding to the top.

```javascript
newAnnot.setPadding(new Annotations.Rect(0, 0, 0, 50));

```

You’ll have to increase the height of the annotation as well.

We have some small improvements coming to the freetext annotation in the next patch so this may help with the text getting cut off as well.

Thanks!  
Logan
