# Get the raw text from a PDF

**URL:** <https://pdfjs.community/t/get-the-raw-text-from-a-pdf/3321>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [June 18, 2024, 10:55pm UTC](https://pdfjs.community/t/get-the-raw-text-from-a-pdf/3321 "2024-06-18T22:55:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldoh](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@aldoh](https://pdfjs.community/u/aldoh)\
**Post date:** [June 18, 2024, 10:55pm UTC](https://pdfjs.community/t/get-the-raw-text-from-a-pdf/3321/1 "2024-06-18T22:55:05Z")

</div>

**Which product are you using?**

PDF.js Express Viewer  
**PDF.js Express Version**

8.7.4  
**Detailed description of issue**  
I would like to extract the raw text of a pdf file so i can insert it in a table of a database for future use.

---

<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:** [June 19, 2024, 1:52pm UTC](https://pdfjs.community/t/get-the-raw-text-from-a-pdf/3321/3 "2024-06-19T13:52:58Z")

</div>

Hi there,

You can use the loadPageText method to get the text by page:

```javascript
await documentViewer.getDocument().loadPageText(1)

```

Best regards,  
Kevin Kim
