PDF reader?

204 views
Skip to first unread message

Jack Black

unread,
Feb 4, 2017, 3:59:37 AM2/4/17
to DroidScript
DroidScript pdf ı do not read

Steve Garman

unread,
Feb 4, 2017, 4:36:20 AM2/4/17
to DroidScript
I normally open whatever reader is on the phone/tablet.


var path = "/sdcard/Download/MyBill.pdf";
app.OpenFile( path,"application/pdf" );

JAUREGUI

unread,
Feb 8, 2017, 9:20:39 PM2/8/17
to DroidScript
Just a question, Is it posible to read text from a pdf file like app.ReadFile() method?
I am doing something just for me but I had to save as txt file from Adobe, can it be done directly?

Steve Garman

unread,
Feb 9, 2017, 1:35:18 AM2/9/17
to DroidScript
JAUREGUI,

There is nothing built in to DroidScript to parse pdf.

There are JavaScript pdf reader libraries available on github.

I expect some of them would be usable in DroidScript but I have not tested any.

It might be worth looking in npmjs to see if there is anything that can be browserified to make a plugin.

nikhil baby

unread,
Feb 9, 2017, 6:04:27 AM2/9/17
to DroidScript
use online api

Charles Wilt

unread,
Feb 9, 2017, 7:22:59 AM2/9/17
to DroidScript
It is not likely to be browserified due to binary file dependencies.

Dave Smart

unread,
Feb 9, 2017, 9:16:21 AM2/9/17
to DroidScript
I've found a .jar file that does a pretty good job of converting pdf to html if you are interested?  Not sure it will work on Android but it works fine on Windows.  If it works on Android then someone could turn it into a DS plugin ;)

Search on google for these files:-

PDFToHTML.jar
cssbox-4.12.jar

Warren Downs

unread,
Feb 9, 2017, 2:06:17 PM2/9/17
to DroidScript
JAUREGUI, it looks like this example might do what you want, using pure Javascript, with some adaptation.  Instead of using binary AJAX calls to fetch file file from a remote server, you would use the DroidScript low-level file access to read it.  Then you would proceed with the processing.

Be aware that performance will probably not be the best (The Java library Dave mentioned would likely be faster).  Also, with any PDF to text solution, you can lose formatting.

JAUREGUI

unread,
Feb 9, 2017, 3:17:33 PM2/9/17
to DroidScript
Thanks a lot for your time, I will try your suggestions guys, if works will be really helpful.
Reply all
Reply to author
Forward
0 new messages