# Change xfdf object result into text highlight annotation on document load

**URL:** https://pdfjs.community/t/change-xfdf-object-result-into-text-highlight-annotation-on-document-load/846
**Category:** Technical Support
**Created:** [June 24, 2021, 11:23am UTC](https://pdfjs.community/t/change-xfdf-object-result-into-text-highlight-annotation-on-document-load/846 "2021-06-24T11:23:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chats2790](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@chats2790](https://pdfjs.community/u/chats2790)
#### Post date: [June 24, 2021, 11:23am UTC](https://pdfjs.community/t/change-xfdf-object-result-into-text-highlight-annotation-on-document-load/846/1 "2021-06-24T11:23:20Z")

</div>

**PDF.js Express Version**  
7.3.3

**Detailed description of issue**  
Is there a way to convert resulting xfdf object into text highlights. My problem statement is to fetch xfdf object from server and by default convert them into highlightAnnotation on document loading.

**Expected behaviour**  
{Provide a screenshot or description of the expected behaviour}

**Does your issue happen with every document, or just one?**  
{Answer here}

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**  
{Provide a relevant 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: [June 24, 2021, 11:23am UTC](https://pdfjs.community/t/change-xfdf-object-result-into-text-highlight-annotation-on-document-load/846/2 "2021-06-24T11:23:26Z")

</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:
- [Saving a document with annotations](https://pdfjs.express/documentation/basic-operations/save-document/save-with-annotations)
- [Creating custom annotations for your viewer - Saving the custom annotation](https://pdfjs.express/documentation/annotation/custom-annotations#saving-the-custom-annotation)
- [Best practices for PDF.js Express - Store annotations](https://pdfjs.express/documentation/learn-more/best-practices#store-annotations)

APIs:
- [CoreControls.DocumentViewer - setDocumentXFDFRetriever(retriever)](https://pdfjs.express/api/CoreControls.DocumentViewer.html#setDocumentXFDFRetriever__anchor)
- [ExternalAnnotationMerger - getTransformFunction()](https://pdfjs.express/api/ExternalAnnotationMerger.html#getTransformFunction__anchor)
- [CoreControls.Document - extractXFDF(pages)](https://pdfjs.express/api/CoreControls.Document.html#extractXFDF__anchor)

Forums:
- [Unable to save the transparency to fillColor](https://pdfjs.community/t/unable-to-save-the-transparency-to-fillcolor/242/1)
- [PDFJS Express WebViewer - Annotations](https://pdfjs.community/t/pdfjs-express-webviewer-annotations/49/2)
- [How to merge signature annotation with PDF document](https://pdfjs.community/t/how-to-merge-signature-annotation-with-pdf-document/558/1)

---

<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: [June 25, 2021, 3:15pm UTC](https://pdfjs.community/t/change-xfdf-object-result-into-text-highlight-annotation-on-document-load/846/3 "2021-06-25T15:15:00Z")

</div>

Hi there!

Yes, this should definitely be possible. Can you send me an example of what your XFDF from the server looks like? Where are you getting this XFDF?
