# How to customize text selection style

**URL:** <https://pdfjs.community/t/how-to-customize-text-selection-style/2126>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [October 25, 2022, 10:28am UTC](https://pdfjs.community/t/how-to-customize-text-selection-style/2126 "2022-10-25T10:28:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geralt.yang](https://avatars.discourse-cdn.com/v4/letter/g/7feea3/32.png) [@geralt.yang](https://pdfjs.community/u/geralt.yang)\
**Post date:** [October 25, 2022, 10:28am UTC](https://pdfjs.community/t/how-to-customize-text-selection-style/2126/1 "2022-10-25T10:28:34Z")

</div>

**Which product are you using?**

PDF.js Express Viewer v8.7.0

**Detailed description of issue**  
How to customize text selection style,I want to change the front and back cursors after selecting text,I haven’t found any relevant introduction in the document, please explain how to do,I would appreciate it

**Expected behaviour**  
 ![screenshot-20221025-181922](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/6/6b01e4b9d3752fa5866b985014285f004de05969.png)

want remove this cursor,I opened the console and found that it was a cursor drawn with canvas,Don’t know how to customize or delete

**Does your issue happen with every document, or just one?**  
every

**Link to document**  
[textPopup](https://pdfjs.express/documentation/ui-customization/customizing-popup)

**Code snippet**

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [October 25, 2022, 10:28am UTC](https://pdfjs.community/t/how-to-customize-text-selection-style/2126/3 "2022-10-25T10:28:39Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Customize annotation tools - Extend built in tools](https://pdfjs.express/documentation/annotation/customizing-tools.8#extend-built-in-tools)
- [Disabling flattened annotations](https://pdfjs.express/documentation/annotation/disable-annotations)
- [Create custom annotation styles](https://pdfjs.express/documentation/annotation/customizing-default-annotation-styles)

APIs:
- [Core.DisplayModeManager - setDisplayMode(displayMode)](https://pdfjs.express/api/Core.DisplayModeManager.html#setDisplayMode__anchor)
- [UndefinedselectionComplete](https://pdfjs.express/api/namespaces.list.html#event:selectionComplete__anchor)
- [Core.Tools.TextSelectTool](https://pdfjs.express/api/Core.Tools.TextSelectTool.html#__anchor)

Forums:
- [URGENT - Merge XFDF API giving [502] internal error](https://pdfjs.community/t/urgent-merge-xfdf-api-giving-502-internal-error/1092/1)
- [How to change icon for Page Transition Dropdown menu options](https://pdfjs.community/t/how-to-change-icon-for-page-transition-dropdown-menu-options/2098/1)
- [How hide annotation when toolbar group changed](https://pdfjs.community/t/how-hide-annotation-when-toolbar-group-changed/1574/1)

  
  

Share how you are using PDF.js Express in your organization you could win a **$500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free**. Learn more [here](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![zserviss](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zserviss](https://pdfjs.community/u/zserviss)\
**Post date:** [October 25, 2022, 4:44pm UTC](https://pdfjs.community/t/how-to-customize-text-selection-style/2126/4 "2022-10-25T16:44:22Z")

</div>

Hi Yangbojie724,

You can do this by creating your own text selection by using the [TextSelectionModel](https://pdfjs.express/api/Core.Annotations.TextSelectionModel.html) API.

You will have to provide your own canvas so that it can be drawn.

Best Regards,  
Zach Serviss  
Web Development Support Engineer  
PDFTron Systems, Inc.

Share how you are using PDF.js Express in your organization you could win a **$500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free**. Learn more [here](https://utm.guru/ueQNw)
