Android:Read Text from word file with same formatting - android

I want to build an android app which has word file as an input. I should be able to read from the word file and display the text. Text should retain all the formatting of the word file. For example is some text is colored red in word file , app should also display it as red colored text.

2 different libraries comes to my mind on handling microsoft office stuff are Apache POI and docx4j. Have you tried them on your purpose, because they have good API support for retrieving data from documents.
I used Apache POI for excel sheet and I know that it has a good api support for word doc too, but I heard that docx4j is better in handling word documents.
Some links you might check : for Apache POI Validating and reading a Word file in Android
for more info on word documents : What's a good Java API for creating Word documents?
Also please check following link if you are going with Apache POI; you might fail on adding library to your project.. Trying to port Apache POI to Android

Related

How to save file as a word document in Android?

I am building an application in which I have to save text from a string to word document.
I tried to use Apache POI library but i wasn't able to create word file, it was only providing me objects to deal with worksheets.
Is there any others free API's to complete this task?
Apache POI should have all that you need.
As you looking for Word Document creation, please find references below:
HWPF Reference(.doc): POI trunk doesn't have examples as XWPF do, However POI Scratchpad has Testcases around it, please find
POI Scratchpad
Javadoc HWPFDocument
Javadoc org.apache.poi.hwpf.usermodel
XWPF Reference(.docx): Examples from Apache POI SVN Repo
SimpleDocument.java
SimpleImages.java
SimpleTable.java
UpdateEmbeddedDoc.java
Please refer to the following links:
Writing Microsoft Word Documents in Java With Apache POI (Part 1 – Writing Paragraphs)
Writing Microsoft Word Documents in Java With Apache POI (Part 2 – Creating Tables)
And also refer POI Javadocs for XWPF (Word Document).
Other libraries could be docx4j or java2word
Source

Display MS Document file using apache poi library android

I am able to read the xls document but I don't know how to display it in my application. Do anyone have idea how to display MS Document files using apache poi library?
I have tried searching on google, everywhere only how to read document is mentioned not how to display these document. I don't want to modify the data inside document,Just want to display it.
Thanks in advance
The Apache POI library does not display documents in Android. It is for reading and writing those files, not displaying them. Quoting the mission statement:
The Apache POI Project's mission is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). In short, you can read and write MS Excel files using Java. In addition, you can read and write MS Word and MS PowerPoint files using Java. Apache POI is your Java Excel solution (for Excel 97-2008). We have a complete API for porting other OOXML and OLE2 formats and welcome others to participate.

How to create an MS Word document within an Android app

I want to create a word document within an android app and send that document through mail.
Is there any tutorial for creating a word document in android. I have gone through several other questions on this website but i didn't got a clear answer.
can we do this on Android using Apache POI.
If any any sample example exist then please mention.
Thanks in advance.
You can use any Java library in Android, so I do think this would be the way you could accomplish what you want (using Apache POI).
You can send the attachment by adding it as an extra to the Intent you use to create a mail message (lots of examples of that).
Apache POI looks your best bet, but note that the component that deals with Word docs only supports simple files:
HWPF and XWPF for Word Documents
HWPF is our port of the Microsoft Word 97 (-2003) file format to pure Java. It supports read, and limited write capabilities. It also provides simple text extraction support for the older Word 6 and Word 95 formats. Please see the HWPF project page for more information. This component remains in early stages of development. It can already read and write simple files.
We are also working on the XWPF for the WordprocessingML (2007+) format from the OOXML specification. This provides read and write support for simpler files, along with text extraction capabilities.
You should seriously consider whether you can use a different format for your emails - plain text, or maybe HTML.

Does MUPDF Reads ASCII? and if not, I would like to know how does he handle the English format as I want to make him handle Arabic format?

I am working on Android App that uses MUPDF reader to read pdf files, these pdf files contain Arabic letters and I want to use the search inside the mupdf to search for these Arabic letters, it only can find one letter but not a complete word, I tried to know if mupdf reads using ascii but I couldn't, so is there any methodology to make the mupdf finds whole Arabic words?
I was using Mupdf version 1.2, it was not supporting LTR and RTL but after I have downloaded version 1.3 which was released in 15-8 I can now write any Arabic word in reversed order and the Mupdf will finds it.
you can find the latest version here: http://www.mupdf.com/download/
Left-to-right and right-to-left searching ought to work, if it doesn't then I suggest you open a bug report at bugs.ghostscript.com and attach a file where the search doesn't work. The simplest file you can manage would be appreciated.

Text to Speech Android Application Query

i want to build an application on Android platform that will convert text to speech for the text,documents,pdf files. Multireader app. does the same thing.
is there any open source app. similar to this ?
i know how to build text to speech for text ,but how to make it work for other file types ?
You need to read those other file types and convert it to plain text. Then you take the plain text and read it. I am sure that there are open apis for pdf documents that allow you to read a document and extract the text.

Categories

Resources