dquangsinh / iphoneebooks

Automatically exported from code.google.com/p/iphoneebooks
GNU General Public License v2.0
0 stars 0 forks source link

Add MS DOC support (patch included) #72

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
to add msword doc support:

$ svn diff
Index: EBookView.m
===================================================================
--- EBookView.m (revision 214)
+++ EBookView.m (working copy)
@@ -157,6 +157,16 @@
     {
       theHTML = [self HTMLFileWithoutImages:thePath];
     }
+  else if ([[[thePath pathExtension] lowercaseString] isEqualToString:@"doc"]) 
+   {
+       NSDictionary * htmlcontent = CopyHTMLForOfficeFileAt([NSURL 
fileURLWithPath:thePath], @"msoffice-
resource:");
+       if (htmlcontent)
+       {
+               theHTML = [[htmlcontent objectForKey:@"HTMLMainContent"] 
retain];
+
+               [htmlcontent release];
+       }
+   }
   else if ([[[thePath pathExtension] lowercaseString] isEqualToString:@"pdb"]) 
     { 
       // This could be PalmDOC, Plucker, iSilo, Mobidoc, or something completely different
Index: Makefile
===================================================================
--- Makefile    (revision 214)
+++ Makefile    (working copy)
@@ -1,8 +1,8 @@
-CC=arm-apple-darwin-cc
+CC=arm-apple-darwin-gcc
 CFLAGS=-O3
 CPPFLAGS=-I/opt/local/include
 LD=$(CC)
-LDFLAGS=-L$(HEAVENLY)/usr/lib -lz -lobjc -framework CoreFoundation -framework 
Foundation -framework 
UIKit -framework LayerKit -framework CoreGraphics -framework GraphicsServices
+LDFLAGS=-L$(HEAVENLY)/usr/lib -lz -lobjc -framework OfficeImport -framework 
CoreFoundation -framework 
Foundation -framework UIKit -framework LayerKit -framework CoreGraphics 
-framework GraphicsServices -
force_cpusubtype_ALL

 all:    Books

Index: BooksApp.m
===================================================================
--- BooksApp.m  (revision 214)
+++ BooksApp.m  (working copy)
@@ -582,7 +582,7 @@

     [navBar setDelegate:self];
     [navBar setBrowserDelegate:self];
-    [navBar setExtensions:[NSArray arrayWithObjects:@"txt", @"htm", @"html", 
@"pdb", @"jpg", @"png", @"gif", nil]];
+    [navBar setExtensions:[NSArray arrayWithObjects:@"txt", @"htm", @"html", 
@"doc", @"pdb", @"jpg", @"png", 
@"gif", nil]];
     [navBar hideButtons];

     [navBar disableAnimation];

good luck,
//W

Original issue reported on code.google.com by mcy...@gmail.com on 10 Nov 2007 at 12:07

GoogleCodeExporter commented 8 years ago

Original comment by pendorbo...@gmail.com on 17 Feb 2008 at 6:08

GoogleCodeExporter commented 8 years ago

Original comment by pendorbo...@gmail.com on 17 Feb 2008 at 6:16