Comments (4)
The short answer is: by processing the text and cutting it into page-sized chunks.
Longer answer: this means you cannot directly display the text in a webview, but you have to process it first.
from epublib.
By processing the text do you mean that i need to parse the whole xhtml spine and setting spans for each tag??
from epublib.
From your comments on another issue I understand you're using HtmlSpanner now.
This means you should already have a Spanned text, so now all you have to do is to take the right sub-string to leave you with exactly one page of text. My solution was to use a StaticLayout to measure how much text fits on the screen, and then put that sub-string in the TextView.
Take a look at this code to see what I mean, but be careful: it's GPL licenced:
https://github.com/NightWhistler/PageTurner/blob/master/src/main/java/net/nightwhistler/pageturner/view/SinglePageStrategy.java
from epublib.
Hi,
I am also using staticLayout. But, My layout.getLineStart(topLine); and layout.getLineEnd(bottomLine) not working properly. It's giving topLine number+1 and bottomLine number +1 value :( I Have tried/searched lot but no luck. Could you please help me on this regard.
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.