summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-27 14:14:52 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-27 17:01:06 +0200
commit4355fda4abe7e7022e3e258c276ccba9e4713d91 (patch)
tree7a21c614bad51f8157c56db60d658f77ad6273b6 /docs
parenta1c86cfcea30b18734488935c636a5d7198b3983 (diff)
downloadmupdf-4355fda4abe7e7022e3e258c276ccba9e4713d91.tar.xz
Tweak pdf-write option handling.
The handling of not-decompressing images/fonts was geared towards pdfclean usage; but now that we can create new PDF files, it makes more sense to ask for images and fonts to be compressed, rather than asking for them not to be decompressed with quirky interaction with the 'expand' and 'deflate' flags. If -f or -i are set, we will never decompress images, and we will compress them if they are uncompressed. If -d is set, we will first decompress all streams (module -f or -i). If -z is set, we will then compress all uncompressed streams.
Diffstat (limited to 'docs')
-rw-r--r--docs/mutool/examples/pdf-create.js2
-rw-r--r--docs/mutool/examples/pdf-merge.js2
-rw-r--r--docs/mutool/run.html13
3 files changed, 13 insertions, 4 deletions
diff --git a/docs/mutool/examples/pdf-create.js b/docs/mutool/examples/pdf-create.js
index 38c193a3..131e72b3 100644
--- a/docs/mutool/examples/pdf-create.js
+++ b/docs/mutool/examples/pdf-create.js
@@ -32,4 +32,4 @@ var page = pdf.addPage([0,0,300,350], 0, resources, contents)
pdf.insertPage(-1, page)
// Save the document to file.
-pdf.save("out.pdf")
+pdf.save("out.pdf", "paif")
diff --git a/docs/mutool/examples/pdf-merge.js b/docs/mutool/examples/pdf-merge.js
index a468738a..6f5d4692 100644
--- a/docs/mutool/examples/pdf-merge.js
+++ b/docs/mutool/examples/pdf-merge.js
@@ -57,7 +57,7 @@ function pdfmerge() {
srcDoc = new PDFDocument(argv[i])
copyAllPages(dstDoc, srcDoc)
}
- dstDoc.save(argv[1])
+ dstDoc.save(argv[1], "z")
}
if (argv.length < 3)
diff --git a/docs/mutool/run.html b/docs/mutool/run.html
index 0b8e86d1..f9278b2b 100644
--- a/docs/mutool/run.html
+++ b/docs/mutool/run.html
@@ -481,8 +481,18 @@ using low level access to the objects and streams contained in a PDF file.
<dd>Get access to the raw PDFDocument from a Document; returns null if the document is not a PDF.
<dt>PDFDocument#toDocument()
<dd>Cast the PDF document to a Document.
-<dt>PDFDocument#save(fileName)
+<dt>PDFDocument#save(fileName, options)
<dd>Write the PDF document to file.
+The write options are a string of flag characters:
+<br>l: linearize,
+<br>g: garbage collect, gg: ...and compact, ggg: ...and de-duplicate,
+<br>p: pretty-print objects,
+<br>a: ascii hex encode streams,
+<br>f: compress fonts,
+<br>i: compress images,
+<br>z: compress all streams,
+<br>d: decompress all streams (except fonts or images if 'f' or 'i'),
+<br>s: sanitize content streams.
</dl>
<h3>
@@ -631,7 +641,6 @@ There are several areas in MuPDF that still need bindings to access from JavaScr
<ul>
<li>Shadings
<li>PDFDocument#graftObject()
-<li>PDFDocument#save() -- write options
<li>PDFWriteDevice
<li>DocumentWriter
</ul>