Comments (10)
Hi Jason,
Epublib doesn't use javax.xml.stream classes for quite a while now.
Where did you find the version you're using ?
Paul
from epublib.
Hi Paul,
I downloaded the source from github https://github.com/psiegman/epublib.
I am using Java jdk 1.6.0_27 and jre 6, netbeans 7.0.1, kenai android plugin for netbeans.
I ran the Maven build and import the jar to my project, copied the script Simple1 from your site and ran a test.
The message above is what I received from the output.
I thought I was missing the correct android api's, after some research in androids documentation, I found nothing.
from epublib.
The location were I found the code is:
nl/siegmann/epublib/epub/EpubWriter.class in F:\Android\psiegman-epublib-787d1f6\epublib-tools\target\epublib-tools-3.0-SNAPSHOT-complete.jar
from epublib.
Aha. Only epublib-core works on android.
It will enable you to read/change/write epubs just fine.
Use only epublib-core and you should be good.
from epublib.
Hey Paul,
Still the same thing.
here is a snippet from the EpubWriter.class
using only core: epublib-core-3.0-SNAPSHOT.jar
package nl.siegmann.epublib.epub;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.ZipOutputStream;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLStreamException; <-<-<- this is were the problem is coming up. The compiler can't find this file.
import nl.siegmann.epublib.domain.Book;
import nl.siegmann.epublib.domain.Resource;
public class EpubWriter
{
private static final org.slf4j.Logger log;
static final String EMPTY_NAMESPACE_PREFIX = "";
private BookProcessor bookProcessor;
from epublib.
Wow, you're correct. I totally overlooked those classes.
I've removed them and uploaded a new version.
Could you check whether it works for you ?
from epublib.
Hey Paul,
Ok so your fix worked but another issue. Not sure if this one is from you or not.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lnl/siegmann/epublib/browsersupport/NavigationEvent;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
at com.android.dx.command.dexer.Main.processClass(Main.java:372)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
at com.android.dx.command.dexer.Main.access$400(Main.java:59)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
at com.android.dx.command.dexer.Main.processOne(Main.java:313)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
at com.android.dx.command.dexer.Main.run(Main.java:185)
at com.android.dx.command.dexer.Main.main(Main.java:166)
at com.android.dx.command.Main.main(Main.java:90)
1 error; aborting
from epublib.
Hi Jason,
I've finally found the time to have a look at it, and writing an epub file works fine on an 2.2 emulator.
Code:
EpubWriter epubWriter = new EpubWriter();
FileOutputStream out = openFileOutput("testbook.epub", 0);
epubWriter.write(book, out);
out.close();
Log.i("epublib", "done writing file");
If it's not working for you can you send me some example code ?
from epublib.
Hey Paul,
Sorry I am getting back to you now. I tried to code and it worked great.
Thanks for all our help.
Jason Foglia
On Sun, Oct 9, 2011 at 6:42 AM, Paul Siegmann <
[email protected]>wrote:
Hi Jason,
I've finally found the time to have a look at it, and writing an epub file
works fine on an 2.2 emulator.Code:
EpubWriter epubWriter = new EpubWriter(); FileOutputStream out =
openFileOutput("testbook.epub", 0);
epubWriter.write(book, out);
out.close();
Log.i("epublib", "done writing file");If it's not working for you can you send me some example code ?
Reply to this email directly or view it on GitHub:
#10 (comment)
from epublib.
Hey Paul,
Not sure about this one. I didn't get errors but I also got no file. I tried
changing the path to external but that caused an exception, not sure if that
helps.
I am using the 2.2 emulator too.
Book book = new Book();
book.getMetadata().addTitle("Epublib test book 1");
book.getMetadata().addAuthor(new Author("Test_first_name",
"Test_last_name"));
EpubWriter epubWriter = new EpubWriter();
FileOutputStream out = null;
try
{
out = openFileOutput("testbook.epub", 0);
}catch(FileNotFoundException ex)
{
Log.d(tag, ex.getMessage());
}
try
{
epubWriter.write(book, out);
}catch(IOException ex)
{
Log.d(tag, ex.getMessage());
}
try
{
out.close();
}catch(IOException ex)
{
Log.d(tag, ex.getMessage());
}
java.io.File file = new java.io.File("/", "testbook.epub");
if(file.exists())
Log.d(tag, "file created");
else
Log.d(tag, "file not created");
Thanks!
Jason Foglia
On Fri, Oct 21, 2011 at 11:54 AM, Jason Foglia [email protected]:
Hey Paul,
Sorry I am getting back to you now. I tried to code and it worked great.
Thanks for all our help.Jason Foglia
On Sun, Oct 9, 2011 at 6:42 AM, Paul Siegmann <
[email protected]>wrote:Hi Jason,
I've finally found the time to have a look at it, and writing an epub file
works fine on an 2.2 emulator.Code:
EpubWriter epubWriter = new EpubWriter(); FileOutputStream out =
openFileOutput("testbook.epub", 0);
epubWriter.write(book, out);
out.close();
Log.i("epublib", "done writing file");If it's not working for you can you send me some example code ?
Reply to this email directly or view it on GitHub:
#10 (comment)
from epublib.
Related Issues (20)
- Is this library actively maintained? HOT 11
- NCX not found
- Exception when running a basic programme to read an epub.
- HTML resource with ID "toc" preferred over real NCX resource HOT 1
- Infinite loop HOT 1
- I cannβt create a new epub files because of null pointer exception
- The directory name for content should be configurable
- Dependency on org.kxml2 prevents usage of epublib in modules-enabled projects
- Cannot parse the generated epub HOT 2
- nl.siegmann.epublib:epublib-core version 4.0 is not available?! HOT 2
- Fork of your project
- epublib-core could avoid sl4j-simple binding
- error with the content.opf
- Watermark existing EPUB
- dependencies
- can't open file epub create on android
- ERROR nl.siegmann.epublib.viewer.Viewer - Data descriptor signature not found HOT 1
- please release the repo into maven repository HOT 1
- Proguard rules? HOT 1
- Major bug, there is a dead cycle in parsing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epublib.