Giter VIP home page Giter VIP logo

Comments (10)

psiegman avatar psiegman commented on June 30, 2024

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.

JasonFoglia avatar JasonFoglia commented on June 30, 2024

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.

JasonFoglia avatar JasonFoglia commented on June 30, 2024

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.

psiegman avatar psiegman commented on June 30, 2024

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.

JasonFoglia avatar JasonFoglia commented on June 30, 2024

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.

psiegman avatar psiegman commented on June 30, 2024

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.

JasonFoglia avatar JasonFoglia commented on June 30, 2024

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.

psiegman avatar psiegman commented on June 30, 2024

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.

JasonFoglia avatar JasonFoglia commented on June 30, 2024

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.

JasonFoglia avatar JasonFoglia commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.