Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5999743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:35:43+00:00 2026-05-23T00:35:43+00:00

All the documentation I can find seems to suggest I can only extract the

  • 0

All the documentation I can find seems to suggest I can only extract the entire file’s content. But I need to extract pages individually. Do I need to write my own parser for that? Is there some obvious method that I am missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:35:44+00:00Added an answer on May 23, 2026 at 12:35 am

    Actually Tika does handle pages (at least in pdf) by sending elements <div><p> before page starts and </p></div> after page ends. You can easily setup page count in your handler using this (just counting pages using only <p>):

    public abstract class MyContentHandler implements ContentHandler {
        private String pageTag = "p";
        protected int pageNumber = 0;
        ...
        @Override
        public void startElement (String uri, String localName, String qName, Attributes atts) throws SAXException  {  
    
            if (pageTag.equals(qName)) {
                startPage();
            }
        }
    
        @Override
        public void endElement (String uri, String localName, String qName) throws SAXException {  
    
            if (pageTag.equals(qName)) {
                endPage();
            }
        }
    
        protected void startPage() throws SAXException {
        pageNumber++;
        }
    
        protected void endPage() throws SAXException {
        return;
        }
        ...
    }
    

    When doing this with pdf you may run into the problem when parser doesn’t send text lines in proper order – see Extracting text from PDF files with Apache Tika 0.9 (and PDFBox under the hood) on how to handle this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read the documentation and searched all over but I can't find how
It seems that all of the documentation I can find about OpenGL-ES says something
I've searched all over the web and can't seem to find documentation or even
February, 26 2010 21:34:00 Based on all the documentation I can find, MMMM, d
The dotless documentation is quite limited. I can't find much information at all about
I am reading the doc Spring 3.1 security documentation extensively, but I can't find
I'm new to MVC, but I've been all over this, read all the documentation
Where can I find documentation on running JavaScript code inside a PDF? I've never
If we check the official documentation we can find various ways of interfacing Erlang
Disclaimer: I've looked through all the questions I can find and none of them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.