string formatting - Display html formatted text, split into page-sized chunks-- methods? -


i'm building web application better give writers constructive criticism. part of involves fetching portions of html-formatted text, scribbled on html5's canvas. if marking page red pen.

i'm having trouble figuring out best way display page-worth (500 x 600px) of text @ time. wordcount work, cut things off @ awkward places. character count, stripped of tags, plus space paragraph breaks may work better, on mono-type font.

so what's best way automatically cut text based on size? or need approach entirely?

here's solution found:

pomax's 'bookstyle' did trick, using javascript , bit of php sanitize text.

the text loaded dynamically generated page-sized div until overflows specified clientheight. when hits overflow, refills page minus last paragraph, attempts add said paragraph word word until bottom of page filled. last, pages 'navigated through' hide() , show() commands.

it bottlenecks on last paragraph each time, , had trouble browser automatically trying close tags adding each word individually, on whole needed do.

http://pomax.nihongoresources.com/downloads/bookstyle/

all credit, of course, goes pomax.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -