Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Submit your requests and polls about new features
  • Page:
  • 1
  • 2

TOPIC:

Identify a searchable PDF 9 years 1 month ago #8689

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
The code seems ok, but we need you to give us a pdf to be used for further investigation...

If you do not want to share the pdf here on the forum, you can create a support ticket and upload the pdf there. (only you and us can see the ticket)

Please Log in or Create an account to join the conversation.

Identify a searchable PDF 9 years 1 month ago #8709

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
At the end there was an error in the code above, the working code is:
public boolean isPDFSearchable(Document m_doc) {
        if (m_doc != null) {
            int totalPageCount = m_doc.GetPageCount();
            for (int pageCount = 0; pageCount <= totalPageCount - 1; pageCount++) {
                Page page = m_doc.GetPage(pageCount);
                page.ObjsStart();
                String text = page.ObjsGetString(0, page.ObjsGetCharCount() - 1);
                if (text != null && text.trim().length() > 0) {
                    return true;
                }
            }
        }
        return false;
    }

For more info please check this article.
The following user(s) said Thank You: arcmobile.div

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum