![]() | Logo by Nickman (anonymous IP: 216.73.216.69,2507) | |||||||||||||
| ||||||||||||||
Audio (351) Datatype (51) Demo (211) Development (628) Document (24) Driver (102) Emulation (155) Game (1051) Graphics (516) Library (123) Network (242) Office (69) Utility (961) Video (74) Total files: 4558 Full index file Recent index file
Amigans.net Aminet IntuitionBase Hyperion Entertainment A-Eon Amiga Future
Support the site
|
Short: MuPDF command-line tool (mutool) for AmigaOS 4.1
Author: MuPDF: Artifex Software, Inc. and contributors / AmigaOS4 port:
Falke_34
Uploader: Falke_34
Type: utility/text/convert
Version: 1.28.2
Architecture: ppc-amigaos >= 4.1
Distribution: Aminet, OS4Depot
Requires: AmigaOS 4.1 or higher, newlib
----------------------------------------------------------------------
DESCRIPTION
mutool is the official command-line tool of MuPDF, a lightweight and
fast PDF, XPS, EPUB, CBZ and image rendering library. This package
contains a native AmigaOS 4.1 (PowerPC, newlib) port of mutool,
cross-compiled from the original MuPDF 1.28.2 sources.
This archive contains two build variants:
mupdf-amiga/ Full build with Noto fallback fonts
(Base14 + Noto + CJK/Droid + SIL, ~112 MB).
Characters outside Base14 coverage render
correctly in documents without embedded fonts.
mupdf-amiga-notofree/ Minimal build, Base14 URW fonts only (~12 MB).
Characters outside Base14 coverage display as
tofu placeholder boxes. Use this variant when
binary size matters and broad Unicode fallback
is not required.
mutool can:
- render PDF, EPUB, XPS, CBZ, FB2, MOBI, Markdown and image
documents to PNG, PNM, PAM, PGM, PBM, PWG, PCL and PS
- convert between document formats (e.g. EPUB -> PDF, EPUB -> DOCX,
PDF -> SVG, any supported format -> plain text)
- extract text, structured text and metadata from PDF documents
- display PDF document info (mutool info, PDF only)
- merge, split, clean and repair PDF files
- decode JPEG2000 (JP2/JPX) images via the bundled OpenJPEG library
- execute PDF JavaScript (mujs engine, enabled in this build)
The lib/ and include/ directories are provided so that other AmigaOS4
developers can link MuPDF into their own applications without having
to set up the whole cross-compile toolchain themselves.
(e.g. as used by the AmiBookReader e-book reader)
----------------------------------------------------------------------
CONTENTS OF THE ARCHIVE
Both variants share the same directory layout:
mupdf-amiga/ (full Noto build)
mupdf-amiga-notofree/ (minimal / Base14-only build)
bin/mutool - the command-line tool, stripped
lib/libmupdf.a - MuPDF core library
lib/libmupdf-third.a - bundled third-party libraries
(zlib, libjpeg, freetype, harfbuzz,
openjpeg, jbig2dec, lcms2, mujs,
gumbo-parser, brotli, extract)
lib/libmupdf-threads.a - threading helper library
lib/libmupdf-pkcs7.a - PKCS#7 / digital signature helper
library (PDF signature verification
disabled at build time, see BUILD
NOTES; included for ABI completeness)
include/mupdf/... - C headers for application development
(#include <mupdf/fitz.h> etc.)
----------------------------------------------------------------------
INSTALLATION
Copy bin/mutool from your preferred variant to a directory in your
search path, e.g.:
Copy mupdf-amiga/bin/mutool C:mutool
For application development, copy lib/ and include/ from your chosen
variant to your SDK directory and link against them, e.g.:
gcc ... -Ipath/include -Lpath/lib
-Wl,--start-group -lmupdf -lmupdf-third -lmupdf-threads
-lmupdf-pkcs7 -Wl,--end-group -lz -lm -lpthread -lauto
----------------------------------------------------------------------
USAGE EXAMPLES
Show mutool version:
mutool -v
Show PDF document info (PDF only):
mutool info document.pdf
Render all pages of a document to PNG (one file per page):
mutool draw -o page%d.png -r 150 document.pdf
Render a single page to PNG:
mutool draw -o page.png -r 150 document.pdf 1
Extract plain text from any supported document (UTF-8):
mutool draw -F text -o output.txt document.pdf
Convert EPUB to PDF:
mutool convert -o output.pdf book.epub
Convert text/EPUB to DOCX (openable in word processors and in
AmiBookReader):
mutool convert -o output.docx book.epub
Decode a JPEG2000 (JP2) image to PNG:
mutool convert -o output.png image.jp2
NOTE: "mutool info" only supports PDF documents (it calls the PDF
parser directly). For other formats (EPUB, FB2, MOBI, CBZ, Markdown,
images, etc.) use "mutool draw" or "mutool convert" instead, which
use MuPDF's generic document handler and support all of the formats
listed above.
----------------------------------------------------------------------
TESTED ON
- AmigaOS 4.1 FE, QEMU (Pegasos2/AmigaOne emulation)
- PDF rendering (text + embedded JPEG/JPX images), all pages
- EPUB3 rendering, pagination and text extraction
- JPEG2000 (JP2) decoding via convert
- DOCX output, reopened successfully in AmiBookReader
A "premature end of file in jpeg" warning may appear for individual
malformed embedded images in some PDF files; this does not affect
the rest of the document and is not specific to this AmigaOS port.
----------------------------------------------------------------------
BUILD NOTES (AmigaOS4-SPECIFIC PATCHES)
This is a cross-compiled build (Ubuntu host, Docker, GCC 11,
ppc-amigaos-gcc, -mcrt=newlib), using the standard MuPDF 1.28.2
release sources with the following AmigaOS4/newlib compatibility
patches applied automatically by the build script:
1. Header fixes:
- <sys/time.h> is not available; the include is removed.
- <memory.h> is replaced with <string.h>.
- u_int8_t/u_int16_t/u_int32_t are mapped to the standard
uint8_t/uint16_t/uint32_t types via compiler -D defines.
2. Format-specifier fix:
MuPDF uses int64_t with %ld in pdf-object.c. On PPC 32-bit
(AmigaOS4), long is 32 bits while int64_t is long long, making
%ld the wrong specifier. The build script replaces %ld with %lld
for all int64_t arguments to avoid undefined behaviour and
potential data corruption when printing large object numbers.
3. OpenJPEG big-endian fix:
The bundled OpenJPEG library does not auto-detect PowerPC's
big-endian byte order during cross-compilation. opj_config.h
is patched to force OPJ_BIG_ENDIAN=1, which is required for
correct JPEG2000 (JP2/JPX) decoding on PPC.
4. timegm() replacement:
newlib does not provide timegm(). A small, portable, timezone-
independent replacement (my_timegm) is injected into every
source file that calls timegm() (used for parsing PDF date
metadata).
Build configuration (both variants):
HAVE_X11=no HAVE_GLUT=no HAVE_WIN32=no HAVE_LIBCRYPTO=no
HAVE_OBJCOPY=no BUNDLED_OPENJPEG=yes build=release
FZ_ENABLE_JS=1
CFLAGS: -mlong-double-64 (forces 64-bit long double, suppresses
the "floating point ABI 9" linker warning from the
AmigaOS4 linker when linking objects built with GCC 11)
Font sets:
mupdf-amiga: Base14 + Noto + CJK/Droid + SIL
mupdf-amiga-notofree: Base14 only (-DTOFU -DTOFU_CJK)
JavaScript support (mujs) is enabled in both variants. The GL/X11/
Win32 UI frontends are disabled, as they are not applicable on
AmigaOS4.
PDF digital signature verification (PKCS#7 via OpenSSL) is disabled
(HAVE_LIBCRYPTO=no). AmiSSL cannot be used for this purpose because
MuPDF's pkcs7-openssl.c calls the OpenSSL C API directly (BIO_new,
PKCS7_free, etc.), while AmiSSL exports these only through AmigaOS
interface function pointers (IAmiSSL->BIO_new()), making them
link-incompatible. A cross-compiled OpenSSL 3.x static library for
ppc-amigaos would be required to enable this feature.
libcurl is linked when present in the build environment, enabling
HTTP/HTTPS document access in mutool. The TLS backend is AmiSSL via
libamisslstubs.
----------------------------------------------------------------------
LICENSE / SOURCE CODE
MuPDF is Copyright (C) Artifex Software, Inc. and is licensed under
the GNU Affero General Public License (AGPL) version 3, or under a
commercial license available from Artifex Software.
The unmodified original MuPDF 1.28.2 source code is available from:
https://mupdf.com/downloads/
In accordance with the AGPL, the AmigaOS4-specific patches applied
during this build are documented above and the full build script
used to produce this package is included with this distribution
(or available from the uploader on request), so that anyone can
reproduce this build from the original MuPDF sources.
This package itself (the AmigaOS4 binaries and the build script) is
provided free of charge for the AmigaOS4 community. No warranty is
given; use at your own risk.
----------------------------------------------------------------------
CREDITS
- Artifex Software, Inc. and the MuPDF contributors for MuPDF
- walkero for the amigagccondocker AmigaOS4 cross-compile toolchain
- Falke_34 - AmigaOS4 cross-compile build script and testing
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright © 2004-2026 by Björn Hagström All Rights Reserved |