Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we extract text from word page by page #129

Open
Anupam750 opened this issue Nov 5, 2018 · 8 comments
Open

Can we extract text from word page by page #129

Anupam750 opened this issue Nov 5, 2018 · 8 comments

Comments

@Anupam750
Copy link

please explain, How can i get text from pdf, word page by page?

@KevM
Copy link
Owner

KevM commented Nov 7, 2018

Look at the unit tests. 🤗

@bugybunny
Copy link

I‘m also interested in this (but for PDFs). I guess you mean tikaondotnet/src/TikaOnDotNet.Tests/text_extraction.cs, right? I couldn‘t find an example for that.

@Anupam750
Copy link
Author

I have also checked it and did not found anything related to page in code as you said..

@KevM
Copy link
Owner

KevM commented Nov 8, 2018 via email

@bugybunny
Copy link

bugybunny commented Nov 11, 2018

We want to extract the text of a .pdf or .docx (or .doc dunno, I can’t speak for Anupam75) page by page. I currently just use new TextExtractor().Extract(filename.pdf) .Text to get the text from a PDF. But I would love to know where the page breaks are.
I somewhere read that PDFBox outputs a <br> at the beginning of each page but I don’t know what method I need to call to get this behaviour from Tika/TikaOnDotNet.

@KevM
Copy link
Owner

KevM commented Nov 13, 2018

I don't believe that is an option that Tika offers. Tika is a high level abstraction. If you wanted to do that more precisely I would look at using POI directly. https://poi.apache.org/text-extraction.html

@bugybunny
Copy link

bugybunny commented Nov 14, 2018

Can you make something out of this answer? https://stackoverflow.com/a/6271696/4040068

I thought that it’s not possible and I know that Tika is just an abstraction layer to get the content from so many different formats. I have to use .NET (so PDFBox itself is not an option, there’s a PDFBox with IKVM but it’s not maintained anymore) and TikaOnDotNet was the only pdf extraction tool that I can use concerning the license and doesn’t cost a lot of money. So I was hoping I can still use it for a bit more than just plain extraction, but it’s not really a problem :)

@KevM
Copy link
Owner

KevM commented Nov 15, 2018

You might be able to hook into Tika to get the raw markup. Not sure. Let me know what you find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants