# How to extract name and page using xfdf data

**URL:** <https://pdfjs.community/t/how-to-extract-name-and-page-using-xfdf-data/2373>\
**Category:** Technical Support\
**Created:** [February 14, 2023, 5:36pm UTC](https://pdfjs.community/t/how-to-extract-name-and-page-using-xfdf-data/2373 "2023-02-14T17:36:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakshitha\_r](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@rakshitha\_r](https://pdfjs.community/u/rakshitha_r)\
**Post date:** [February 14, 2023, 5:36pm UTC](https://pdfjs.community/t/how-to-extract-name-and-page-using-xfdf-data/2373/1 "2023-02-14T17:36:04Z")

</div>

**Which product are you using?**

PDF.js Express Plus  
**PDF.js Express Version**

8  
**Detailed description of issue**  
i have xfdf data and from xfdf data i need to extraxt name and page from that. is there any way i can get the values of name and page from the xfdf data.

```javascript
 const xfdfString = await instance.Core.annotationManager.exportAnnotations();

```

i am able to get the value of xfdfString value from above as

```javascript
<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><pdf-info xmlns="http://www.pdftron.com/pdfinfo" version="2" import-version="4" /><fields /><annots><square page="3" rect="64,311.750,317,539.750" color="#FF0000" flags="print" name="fb32b83b-7dbc-c6c0-96be-0af5284a49ee" title="admin" subject="Rectangle" date="D:20230214225127+05'30'" width="3" creationdate="D:20230214225126+05'30'"/></annots><pages><defmtx matrix="1,0,0,-1,0,792" /></pages></xfdf>

```

so from above output i need to extract name and page values  
**Expected behaviour**  
{Provide a screenshot or description of the expected behaviour}  
i need to extract name and page from xfdfString  
**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:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [February 14, 2023, 6:09pm UTC](https://pdfjs.community/t/how-to-extract-name-and-page-using-xfdf-data/2373/2 "2023-02-14T18:09:58Z")

</div>

Hi there,

Thanks for reaching out to pdf.js express forums,

From the raw xfdf data, there are page numbers associated with each annotation. For example in the xfdf you provided, there is a page number associated with the square, so you could extract that with string manipulation.

We recommend you to import the xfdf to an annotation, then use the annotation to get the data you need.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/9/9dca6991cd1a8a8ce48dce90633ebe1d98d5d252.png)

Best regards,  
Kevin Kim

---

<div class="post-metadata">

**Author:** ![rakshitha\_r](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@rakshitha\_r](https://pdfjs.community/u/rakshitha_r)\
**Post date:** [February 15, 2023, 4:11pm UTC](https://pdfjs.community/t/how-to-extract-name-and-page-using-xfdf-data/2373/3 "2023-02-15T16:11:01Z")

</div>

thanks kkim, your solution really helped me a lot
