Bug 52325 - Android doc to html porting
Summary: Android doc to html porting
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.8-dev
Hardware: PC other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 17:25 UTC by Johann Hilbold
Modified: 2011-12-16 10:57 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johann Hilbold 2011-12-13 17:25:17 UTC
I'm looking for a lightweight version of poi-3.8.jar to use it in an Android (private) app. 
I don't seem to be able to fit the whole 1.7Mb jar in the APK for some reason (and it would be wrong to do so anyway) and since I'm only looking for the doc -> html and xls -> html functionality, I'm not quite sure I need the whole jar file. 

I've spent a couple hours trying to figure out how to extract WordToHtmlExtracter.java in poi/hwpf/converter but it looks like it's using a lot of other stuff. Even if this doesn't really surprise me, I was thinking that maybe someone here would know which packages I can get rid of to make the jar smaller. I'll be glad to spend more time on it, unless someone here tells me it's a waste of time and that EVERYTHING in the sources is needed to convert doc to html files.

I don't need anything that displays anything, I just need the "simple" doc to html  (and xls to html if possible) features. I don't need anything related to PDF, powerpoint, outlook or whatever.

Cheers
Comment 1 Nick Burch 2011-12-14 00:12:49 UTC
There have been a few discussions on the mailing list about packaging POI for android, you may want to review those in the archives

Unfortunately, both reading and writing require very similar sets of classes. You could probably knock out a few classes, or quite a few methods, but there's not one whole package you could ignore

Could you maybe split it into two bundles, one for POIFS+HSSF, and one for POIFS+HWPF, to keep the sizes down?
Comment 2 Johann Hilbold 2011-12-14 09:19:58 UTC
I'll try that, thanks!
Comment 3 Yegor Kozlov 2011-12-16 10:57:48 UTC
Here is the list of common packages used by HSSF and HWPF:

// common classes 
org.apache.poi.util
org.apache.poi

// OLE2 file system and properties
org.apache.poi.poifs
org.apache.poi.hpsf

// office drawing
org.apache.poi.ddf


HWPF requires everything in org.apache.poi.hwpf
 A combination of org.apache.poi.hwpf.* and the above packages should be enough to run the doc2html convertor. 

HSSF requires the common stuff plus two package roots: org.apache.poi.hssf and org.apache.poi.ss

That's it. 

P.S. I'm closing this ticket, it is more a question for poi-user than a bug in Bugzilla. 

Yegor