Story¶
mutool only
- new Story(contents, userCSS, em, archive)¶
Constructor method.
Create a new story with the given
contents, formatted according to the provideduserCSSandemsize, and anarchiveto lookup images, etc.- Arguments:
contents –
StringHTML source code. If omitted, a basic minimum is generated.userCSS –
StringCSS source code. If provided, must contain valid CSS specifications.em –
FloatThe default text font size.archive – An
Archivefrom which to load resources for rendering. Currently supported resource types are images and text fonts. If omitted, theStorywill not try to look up any such data and may thus produce incomplete output.
EXAMPLE
var story = new mupdf.Story(<contents>, <css>, <em>, <archive>);
Instance methods
- document()¶
Return an
XMLfor an unplaced story. This allows adding content before placing theStory.- Returns:
XML.
EXAMPLE
var xml = story.document();
- place(rect)¶
Place (or continue placing) a
Storyinto the supplied rectangle, returning a Placement Result Object. Calldraw()to draw the placed content before callingplace()again to continue placing remaining content.- Arguments:
rect –
[ulx,uly,lrx,lry]Rectangle.
- Returns:
EXAMPLE
var result = story.place([0,0,100,100]);