use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testAnnotationBeforeBodyParagraph.
public void testAnnotationBeforeBodyParagraph() {
BookModel bookModel = new BookModel(myDirectory + "annotation_before.fb2");
new FB2Reader(bookModel).read();
ZLTextModel model = bookModel.getBookTextModel();
assertEquals(model.getParagraph(1).getKind(), ZLTextParagraph.Kind.END_OF_SECTION_PARAGRAPH);
}
use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testNotesSimple.
public void testNotesSimple() {
BookModel model = new BookModel(myDirectory + "simple_notes.fb2");
new FB2Reader(model).read();
assertNotNull(model.getFootnoteModel("1"));
}
use of org.geometerplus.fbreader.formats.fb2.FB2Reader in project FBReaderJ by geometer.
the class TestFB2Reader method testImage.
/* public void testPnvs() {
FB2Reader reader = new FB2Reader("M:/Books/pnvs.fb2");
reader.read();
}
*/
public void testImage() {
BookModel model = new BookModel(myDirectory + "image.fb2");
new FB2Reader(model).read();
byte[] image = (model.getImageMap().getImage("cover.jpg")).byteData();
try {
BufferedImage img = ImageIO.read(new ByteArrayInputStream(image));
ImageIO.write(img, "jpg", new File(myDirectory + "img.jpg"));
} catch (IOException e) {
fail();
}
}
Aggregations