only mutool run
Create a new empty tree archive.
var treeArchive = new mupdf.TreeArchive()Add a named buffer to a tree archive.
string) – Name of archive entry
to add.Buffer | ArrayBuffer | Uint8Array | string) – Buffer of
data to store with the entry.var buf = new mupdf.Buffer()
buf.writeLine("hello world!")
var archive = new mupdf.TreeArchive()
archive.add("file2.txt", buf)
print(archive.hasEntry("file2.txt"))