Story
¶
mutool only
- new Story(contents, userCSS, em, archive)¶
Constructor method.
Create a new story with the given
contents
, formatted according to the provideduserCSS
andem
size, and anarchive
to lookup images, etc.- Arguments:
contents –
String
HTML source code. If omitted, a basic minimum is generated.userCSS –
String
CSS source code. If provided, must contain valid CSS specifications.em –
Float
The default text font size.archive – An
Archive
from which to load resources for rendering. Currently supported resource types are images and text fonts. If omitted, theStory
will 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
XML
for an unplaced story. This allows adding content before placing theStory
.- Returns:
XML.
EXAMPLE
var xml = story.document();
- place(rect)¶
Place (or continue placing) a
Story
into 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]);