DocumentWriter¶
DocumentWriter objects are used to create new documents in several formats.
Constructors¶
- class DocumentWriter(buffer, format, options)¶
- class DocumentWriter(filename, format, options)
Create a new document writer to create a document with the specified format and output options. If
formatisnullit is inferred from the filename. Theoptionsargument is a comma separated list of flags and key-value pairs.For supported output
formatvalues andoptionssee Document Writer Options.- Arguments:
var writer = new mupdf.DocumentWriter(buffer, "PDF", "")
Instance methods¶
- DocumentWriter.prototype.beginPage(mediabox)¶
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])
- DocumentWriter.prototype.endPage()¶
Finish the page rendering.
writer.endPage()
- DocumentWriter.prototype.close()¶
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()