From ae9780583c18c949bf975131a24eb8b8361ddbf6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 4 May 2016 21:45:41 +0200 Subject: murun: Add document writer object. --- docs/mutool/run.html | 63 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 12 deletions(-) (limited to 'docs/mutool/run.html') diff --git a/docs/mutool/run.html b/docs/mutool/run.html index ac76a7f5..5d5d73fd 100644 --- a/docs/mutool/run.html +++ b/docs/mutool/run.html @@ -464,6 +464,56 @@ Image objects are similar to Pixmaps, but can contain compressed data. but may be used to decode a down-scaled pixmap. +

+Document Writer +

+ +

+Document writer objects are used to create new documents in several formats. + +

+
new DocumentWriter(filename, format, options) +
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 suffix. The options argument is a comma separated list +of flags and key-value pairs. See below for more details. +
DocumentWriter#beginPage(mediabox, transform) +
Begin rendering a new page. Returns a Device that can be used to render the page graphics. +The transform argument must be an empty array which is set to the transform matrix to be +used with the device functions. +
DocumentWriter#endPage(device) +
Finish the page rendering. +The argument must be the same device object that was returned by the beginPage method. +
DocumentWriter#close() +
Finish the document and flush any pending output. +
+ +

+The current output formats supported are CBZ and PDF. + +

+The CBZ output options are: +

+
resolution=N +
Render each page to an image at N pixels per inch. +
+ +

+The PDF output options are: +

+
linearize
optimize for web browsers. +
garbage +
remove unused objects. +
garbage=compact
Remove unused objects, and compact cross reference table. +
garbage=deduplicate
Remove unused objects, compact cross reference table, and remove duplicate objects. +
pretty
Pretty-print objects with indentation. +
ascii
ASCII hex encode binary streams. +
compress-fonts
Compress embedded fonts. +
compress-images
Compress images. +
compress
Compress all streams. +
decompress
Decompress all streams (except when compress-fonts or compress-images). +
sanitize
Clean up graphics commands in content streams. +
+

PDFDocument and PDFObject

@@ -483,18 +533,7 @@ 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 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). +The write options are a string of comma separated options (see the document writer options).

-- cgit v1.2.3