DocumentWriter objects are used to create new documents in several formats.
Create a new document writer to create a document with the specified
format and output options. If format is null
it is inferred from the filename. The options argument is a
comma-separated list of flags and key-value pairs.
For supported output format values and
options see Document Writer
Options.
var writer = new mupdf.DocumentWriter(buffer, "PDF", "")Begin rendering a new page. Returns a Device that can be used to render the page graphics.
var device = writer.beginPage([0, 0, 100, 100])Finish the page rendering.
writer.endPage()Finish the document and flush any pending output. It is a requirement to make this call to ensure that the output file is complete.
writer.close()