# How do I extract the paragraph position? the same way as we extract the positions in word documents.



##### Post Metadata
- Posted at: over 5 years ago
- Author title: --
- Net upvotes: 1


## Comments
### Comment 1

Hi Praveen,

The most powerful way to extract a paragraph’s position and other data from a PDF document is the iText 7 add-on pdf2Data, which also has an online demo: https://pdf2data.online/
Maybe this Stack Overflow answer by iText’s Alexey Subach can help you: https://stackoverflow.com/questions/55807256/how-can-i-get-the-position-of-the-specified-keyword-in-itext7

While pdf2data is the optimal approach, you can do basic extractions with iText 7 Core using a regular expression:

PdfDocument pdfDocument = new PdfDocument(new PdfReader(inputFile));

ILocationExtractionStrategy strategy = new RegexBasedLocationExtractionStrategy(&quot;regular expression&quot;);

PdfCanvasProcessor canvasProcessor = new PdfCanvasProcessor(strategy);

canvasProcessor.processPageContent(pdfDocument.getPage(1));

pdfDocument.close();

strategy.getResultantLocations(); // now contains all the locations of the matching text

If you want an answer for your specific case, then it is better to post a more detailed question on Stack Overflow pointing out what you have tried and where you are stuck. 
If you have a commercial license, you will also have access to iText customer support over Jira.

Kind regards,
Kenneth Holvoet
iText Software

##### Comment Metadata
- Posted at: almost 5 years ago




## Related Product
[iText by Apryse](https://www.g2.com/products/itext-by-apryse/reviews)

## Related Category
[PDF SDKs](https://www.g2.com/categories/pdf-sdks)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: about 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: about 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: about 13 years ago
  - Comments: 4


