Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
  • Page:
  • 1
  • 2

TOPIC:

Extract text 7 years 6 days ago #12217

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
We have tested your document with the below code, and we were able to extract the text on all pages.
So how you are calling your code? Can you send us a sample project that can be used to replicate the issue?
Global.Init(cordova.getActivity().getApplicationContext());
Document m_doc = new Document();
if(m_doc.Open("/mnt/sdcard/Download/LE_9_text_extract.pdf", "") == 0) {
    for (int i = 0; i < m_doc.GetPageCount(); i++) {
            Page page = m_doc.GetPage(i);
            page.ObjsStart();
            String text = page.ObjsGetString(0, page.ObjsGetCharCount() - 1);
             Log.e("SJHY", "Text:" + text);
             page.Close();
      }
 }
 m_doc.Close();

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

Last edit: by nermeen.

Extract text 7 years 6 days ago #12219

  • miguel.garcia
  • miguel.garcia's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 0
Hi I have copied the same code but changin the document Path and ObjsGetCharCount always return 0.
This is my current code that has been added in RadaeePDFPlugin java class:

Global.Init(cordova.getActivity().getApplicationContext());
Document m_doc = new Document();
String path2OpenFile = "/mnt/sdcard/Android/data/com.efl.sjhy/files/LE_9_Analisis_NL_Seg_Vial/LE_9_Analisis_NL_Seg_Vial_1_20130205.pdf";
if(m_doc.Open(path2OpenFile, "") == 0) {
for (int i = 0; i < m_doc.GetPageCount(); i++) {
Page page = m_doc.GetPage(i);
page.ObjsStart();
String text = page.ObjsGetString(0, page.ObjsGetCharCount() - 1);
Log.e("SJHY", "Text:" + text);
page.Close();
}
}
m_doc.Close();
So, is there any problem with the path?

m_doc.OpenFile returns 0 which means the document has been right opened.

Thanks

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

Extract text 7 years 6 days ago #12225

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Does Global.Init return true? (i.e. are you activating the license correctly?)
As if the license is not activated, the text cannot be extracted.

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

Extract text 7 years 6 days ago #12230

  • miguel.garcia
  • miguel.garcia's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 0
It returns false.
I am using the standard license that comes by default with the plugin.
Do i need to purchase another license for this feature?
Should i use our license (premium) for testing?
Thanks

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

Extract text 7 years 6 days ago #12231

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
If you already have a license you can use it, if you want to use the demo license, you can call RadaeePDFPlugin.activateLicense following this article and make sure that the package name/product id is com.radaee.reader
The following user(s) said Thank You: miguel.garcia

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

Last edit: by nermeen.

Extract text 7 years 6 days ago #12232

  • miguel.garcia
  • miguel.garcia's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 0
Yes you were right i was trying to test our app with test account and as per the article the package name should be com.radaee.reader
After testing with this value i am able to get the whole pdf file text.
Thanks a lot

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum