Mupdf operation reference
Generated from the current declarations. Do not edit this file by hand.
Types, limits and defaults below describe resolved values. Runtime expressions must produce these types. Unknown options are rejected; defaults apply only when omitted. Constructor options must be constant after document composition.
Index#
review#
Review selected PDF pages in a declared order as PNG images, extracted UTF-8 text and crop/rotation metadata. Use this for bounded archival previews and document review. The PDF is captured before execution; fresh native reopening checks every raster and text output. MuPDF renders effective CropBox View appearances with inherited rotation, followed by the requested clockwise quarter turn. Text follows native content order; OCR and arbitrary document editing are outside this route.
Common mistakes and assumptions:
- PDF text extraction is not OCR or a reading-order guarantee.
- Passive rendering does not establish that the source PDF is safe to open in other software.
- Page numbers are one-based and must be unique.
Native binding: PDFDocument / PDFPage.getBounds, toPixmap, toStructuredText; Pixmap.saveAsPNG/saveAsPNM. Output kind: ["image","text"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
source |
Required absolute local .pdf path, captured as an immutable regular-file snapshot before native parsing. Relative paths, URLs, symlinks at the file leaf, encrypted PDFs and files over 16 MiB are rejected. Reuse identity includes the captured source bytes. | {"type":"string","minLength":1,"maxLength":4096} |
required |
pages |
Required ordered list of 1–16 distinct one-based page numbers. For example [2,1,3] reviews page 2 first. Numbers must exist in the native document of at most 128 total pages; selection does not alter the original PDF. | {"type":"array","items":{"type":"integer","minimum":1,"maximum":128},"minItems":1,"maxItems":16} |
required |
dpi |
Raster pixels per inch, 36–300; omission selects 72, where a PDF point is one pixel before UserUnit. Doubling density doubles each image dimension and approximately quadruples pixels. Reduce density or selection when the 4096-pixel dimension or 16,777,216 combined-pixel bound is exceeded. PNG density tags are set to the requested DPI and rounded to whole pixels per metre. | {"type":"integer","minimum":36,"maximum":300} |
72 |
rotation |
Additional clockwise output rotation in degrees: 0,90,180 or270; omission selects 0. Applied after the PDF effective crop/inherited rotation. A 90/270 turn exchanges output width and height; extracted text content/order is unchanged. | {"type":"enum","values":[0,90,180,270]} |
0 |