Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

OnPDFSelectEnd return text without white spaces

More
IP: 111.196.240.216 5 years 7 months ago - 5 years 7 months ago #15405 by radaee
dear user:
it is possible manage on java layer, if you can manage UTF-16.
that Page.ObjsGetString(0, objsCharCount) return whole string value of page, and index of each char in this string shall be in UTF16 order.
another method Page.ObjsGetCharRect() return rectangle of each char.
that mean, you can judge by own, using char rect and space between 2 chars.
but in this way, you shall manage UTF-16 code by yourself.
Last edit: 5 years 7 months ago by radaee.
More
IP: 177.194.84.112 5 years 1 week ago #15622 by thiagopelikan
Could you give me an example how to do this?

For example, in the attached file, the ObjsGetString method gives me:
"TORCIDA T U M U L T U A AMBIENTE"

As I see, the 3 lines in the example are exactly with the same space between the chars

How can I use ObjsGetCharRect and extract the word from a RECT?

Tks,
Thiago
More
IP: 111.196.242.56 5 years 1 week ago - 5 years 1 week ago #15623 by radaee
dear user,
i'm still not sure what you really want.
i share some codes here。
for example, you want get char code and rectangle area of a char by index:
Code:
String sval = page.ObjsGetString(start, end); float[] rect = new float[4]; for( int i = start; i < end; i++) {    char code = sval.charAt(i - start);//encoding as UTF16.    page.ObjsGetCharRect(i, rect);//array as [left,top,right,bottom].    //todo: process each char. }

 
Last edit: 5 years 1 week ago by radaee.
More
IP: 2.234.168.74 5 years 1 week ago #15624 by support
Dear Thiago, your issue seems to be related to the way your test pdf file was generated and how chars are spaced on the page.
May you provide the file, please?
More
IP: 177.194.84.112 5 years 1 week ago #15625 by thiagopelikan
Hi, I had to upload the file to my repository because it has 6MB.

itgames-my.sharepoint.com/:b:/g/personal...zre9kwNyt5w?e=3dSTOv

Tks,
Thiago
More
IP: 111.196.242.56 5 years 1 week ago #15626 by radaee
Hi, we checked this PDF file, and tested in last version  of Edge(chrome core).
the extracted text is:
TORCIDA
T U M U LT U A
AMBIENTE
also, we tested in PDF XChange pro, it is same to Edge.
this is depends on blank judgement of PDF software.
Time to create page: 0.381 seconds
Powered by Kunena Forum