...master 2026-11-10 (4e7201cfc+unstaged)

Story

only mutool run

Constructors

class Story(contents, userCSS, em, archive)

Create a new story with the given contents, formatted according to the provided user-defined CSS and em size, and an archive to lookup images, etc.

var story = new mupdf.Story(<contents>, <css>, <em>, <archive>)

Instance methods

Story.prototype.document()

Return an DOM for an unplaced story. This allows adding content before placing the Story.

var xml = story.document()

Story.prototype.place(rect, flags)

Place (or continue placing) this Story into the supplied rectangle. Call draw() to draw the placed content before calling place() again to continue placing remaining content.

more in the returned object can take either of these values:

do {
        var result = story.place([0, 0, 100, 100])
        // TODO: create device for this bit of story
        story.draw(device, mupdf.Matrix.identity)
        // TODO: close device
} while (result.more)

Story.prototype.draw(device, transform)

Draw the placed Story to the given Device with the given transform.

story.draw(device, mupdf.Matrix.identity)