MuPdf工具简介
IMuPDF is a lightweight PDF, XPS, and E-book viewer.
MuPDF consists of a software library, command line tools, and viewers for various platforms.
The renderer in MuPDF is tailored for high quality anti-aliased graphics. It renders text with metrics and spacing accurate to within fractions of a pixel for the highest fidelity in reproducing the look of a printed page on screen.
The viewer is small, fast, yet complete. It supports many document formats, such as PDF, XPS, OpenXPS, CBZ, EPUB, and FictionBook 2. You can annotate PDF documents and fill out forms with the mobile viewers (this feature is coming soon to the desktop viewer as well).
The command line tools allow you to annotate, edit, and convert documents to other formats such as HTML, SVG, PDF, and CBZ. You can also write scripts to manipulate documents using Javascript.
The library is written modularly in portable C, so features can be added and removed by integrators if they so desire. We also have a Java library using JNI that works on both Oracle’s Java and Android.
Go to the Artifex MuPDF product overview to learn more.
Download packages of the latest release for your system:
MuPDF是一个轻量级的PDF,XPS和电子书阅读器。
MuPDF由各种平台的软件库,命令行工具和查看器组成。
MuPDF中的渲染器专为高质量抗锯齿图形而定制。它将具有度量和间距的文本精确到像素的分数内,以便在屏幕上再现打印页面的外观时获得最高保真度。
观众小巧,快速,完整。它支持许多文档格式,例如PDF,XPS,OpenXPS,CBZ,EPUB和FictionBook 2.您可以注释PDF文档并使用移动查看器填写表单(此功能即将推出到桌面查看器)。
命令行工具允许您注释,编辑文档并将其转换为其他格式,如HTML,SVG,PDF和CBZ。您还可以编写脚本来使用Javascript操作文档。
该库是以便携式C模块化编写的,因此如果需要,可以由集成商添加和删除功能。我们还有一个使用JNI的Java库,它可以在Oracle的Java和Android上运行。
方法
The OpenGL based viewer查看器 can read PDF, XPS, CBZ, EPUB, and FB2 documents. It compiles on any platform that has a GLUT library GLUT库. The latest release builds on Linux, Windows, and MacOS.
Command Line Options
mupdf-gl [options] document [page]
-p password
The password needed to open a password protected PDF file.受保护的pdf文件
-r resolution决议
Set the initial zoom缩放 level, specified as DPI指定为DPI. The default value is 72.
-W width
Set the page width in points for EPUB layout.
-H height
Set the page height in points for EPUB layout.
-S size
Set the default font size in points for EPUB layout.字体尺寸
-U stylesheet样式表
Specify a CSS file containing user styles to load for EPUB layout.
-X
Ignore publisher styles for EPUB layout.忽略EPUB布局的发布者样式。
Mouse Bindings鼠标绑定
The middle mouse button (scroll wheel button) pans the document view.
鼠标右键选择一个区域并将标记的文本复制到剪贴板。
The right mouse button selects a region and copies the marked text to the clipboard.
Key Bindings
Several commands can take a number argument entered before the key, to modify the command. For example, to zoom to 150 dpi, type "150z".
F1 Display help.
i Display document metadata.
o Toggle display of outline.
L Toggle display of links.
r Reload document.
q Quit viewer.
f Toggle fullscreen.
w Shrinkwrap window to fit page.
W Fit page width to window.
H Fit page height to window.
Z Fit page size to window.
[number] z Set zoom resolution in DPI.
+ Zoom in.
- Zoom out.
[ Rotate counter-clockwise.
] Rotate clockwise.
[arrows] or h, j, k, l Pan page in small increments.
b Smart move one screenful backward.向后移动一个屏幕
[space] Smart move one screenful forward.
[comma] or [page up] Go one page backward.向上翻页
[period] or [page down] Go one page forward.前进一页
< Go 10 pages backward.
> Go 10 pages forward.
[number] g Go to page number.
G Go to last page.
m Save current page to navigation history.
t Go back in navigation history.
T Go forward in navigation history.
[number] m Save current page in numbered bookmark.
[number] t Go to numbered bookmark.
/ Start searching forward.
? Start searching backward.
n Continue searching forward.
N Continue searching backward.
mutool convert
The ‘mutool convert’ command converts an input file into another format.
mutool convert [options] -o output input [pages]
The command line options are:
-
input
Input file name. The input can be any of the document formats supported by MuPDF: PDF, XPS, CBZ, unprotected EPUB, FB2, etc.
-
[pages]
Comma逗号分隔 separated list of page ranges. The first page is “1”, and the last page is “N”. The default is “1-N”.
-
-p password
Password to use for password protected PDF documents.
-
-o filename
The output file name. The output file name may have a “%d” in the path, which will be replaced with the page number. If there is no %d, the page number will be appended at the end of the file name for single page formats.输出文件名。输出文件名在路径中可能包含“%d”,将替换为页码。如果没有%d,则页码将附加在单页格式的文件名末尾。
-
-F format
The output format. If missing, it is inferred from the output file name extension. See below for which formats are supported.如果缺少,则从文件扩展名中推断出来
-
-O options
Comma separated list of output options. The set of available options varies depending on the output format. See below for details.
-
-A bits
Number of bits of anti-aliasing to use (0 to 8) when rendering to image based formats. The default is 8.
-
-W width
Page width in points for EPUB layout.
-
-H height
Page height in points for EPUB layout.
-
-S font-size
Font size in points for EPUB layout.
-
-U stylesheet.css
File name of user style sheet for EPUB layout.
-
-X
Disable document styles for EPUB layout.
Image output
CBZ (comic book zip漫画书zip) is a multi-page image format.
The following single page image formats are also supported: PNG, PNM, PAM, TGA, PBM, PKM. Each page is written to a separate file.
The output options (-O flag) for image formats are:
-
rotate=N旋转
Rotate rendered pages N degrees counter-clockwise.
-
resolution=N分辨率
Set both X and Y resolution in pixels per inch.
-
x-resolution=N
Set X resolution in pixels per inch.以像素为单位
-
y-resolution=N
Set Y resolution in pixels per inch.以每英寸像素为单位
-
width=N
Render pages to fit N pixels wide (ignore resolution options).
-
height=N
Render pages to fit N pixels tall (ignore resolution options).
-
colorspace=gray/rgb/cmyk色彩空间
Render using specified colorspace (if output format supports it).
使用指定的颜色空间渲染(如果输出格式支持)
-
alpha
Render pages with an alpha channel and transparent background (if output format supports it).
使用Alpha通道和透明背景渲染页面(如果输出格式支持)