From 9dda5aa73d6dcb72c9f10b87564afe7491575faf Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 4 May 2016 18:00:37 +0200 Subject: Add long output option parsing. Use comma-separated list of flags and key/value pairs, for example: "linearize,resolution=72,colorspace=gray" --- docs/mutool/examples/pdf-create.js | 2 +- docs/mutool/examples/pdf-merge.js | 2 +- docs/mutool/run.html | 22 ++++++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'docs/mutool') diff --git a/docs/mutool/examples/pdf-create.js b/docs/mutool/examples/pdf-create.js index 131e72b3..290d1737 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", "paif") +pdf.save("out.pdf", "pretty,ascii,compress-images,compress-fonts") diff --git a/docs/mutool/examples/pdf-merge.js b/docs/mutool/examples/pdf-merge.js index 6f5d4692..dd5fb2a5 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], "z") + dstDoc.save(argv[1], "compress") } if (argv.length < 3) diff --git a/docs/mutool/run.html b/docs/mutool/run.html index f9278b2b..ac76a7f5 100644 --- a/docs/mutool/run.html +++ b/docs/mutool/run.html @@ -483,16 +483,18 @@ using low level access to the objects and streams contained in a PDF file.
Cast the PDF document to a Document.
PDFDocument#save(fileName, options)
Write the PDF document to file. -The write options are a string of flag characters: -
l: linearize, -
g: garbage collect, gg: ...and compact, ggg: ...and de-duplicate, -
p: pretty-print objects, -
a: ascii hex encode streams, -
f: compress fonts, -
i: compress images, -
z: compress all streams, -
d: decompress all streams (except fonts or images if 'f' or 'i'), -
s: sanitize content streams. +The write options are a string of comma separated options: +
linearize (optimize for "web"), +
garbage (remove unused objects), +
or garbage=compact (... and compact xref table), +
or garbage=deduplicate (... and remove duplicate objects), +
pretty (pretty-print objects), +
ascii (ascii hex encode streams), +
compress-fonts (compress embedded font data), +
compress-images (compress image data), +
compress (compress all streams), +
decompress (decompress all streams (except fonts or images if compress-fonts/images)), +
sanitize (sanitize content streams).

-- cgit v1.2.3