Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Changed: | ||||||||
< < | C++ and Python APIs for MuPDF. | |||||||
> > | C++ and Python APIs for MuPDF | |||||||
Changed: | ||||||||
< < | Overview: | |||||||
> > | Overview | |||||||
Changed: | ||||||||
< < | The C++ MuPDF API: | |||||||
> > | API Stability | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | The C++ and Python MuPDF APIs are currently liable to change.
The C++ MuPDF API
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | The Python MuPDF API: | |||||||
> > | The Python MuPDF API | |||||||
Changed: | ||||||||
< < | ||||||||
> > |
| |||||||
Changed: | ||||||||
< < | Building the C++ and Python MuPDF APIs: | |||||||
> > | Building the C++ and Python MuPDF APIs | |||||||
Changed: | ||||||||
< < | We require:
| |||||||
> > | Requirements: | |||||||
Changed: | ||||||||
< < | All building is done with the scripts/mupdfwrap.py script. | |||||||
> > |
| |||||||
Changed: | ||||||||
< < | Build C++ and Python MuPDF APIs and run basic tests with:
| |||||||
> > | Build C++ and Python MuPDF APIs and run basic tests:
git clone --recursive git://git.ghostscript.com/mupdf.git | |||||||
cd mupdf ./scripts/mupdfwrap.py -b all -t | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Changed: | ||||||||
< < | Debug build:
cd mupdf | |||||||
> > | As above but do a debug build: | |||||||
./scripts/mupdfwrap.py -d build/shared-debug -b all -t | ||||||||
Changed: | ||||||||
< < | ||||||||
> > |
For more information:
| |||||||
Changed: | ||||||||
< < | For more details, run ./scripts/mupdfwrap.py -h to see help, or look at the doc-string at beginning of the script directly. | |||||||
> > | Building auto-generated documentation | |||||||
Changed: | ||||||||
< < | Using the Python API: | |||||||
> > | Build HTML documentation for the C, C++ and Python APIs (using Doxygen and pydoc):
./scripts/mupdfwrap.py --doc allThis will generate these documentation roots:
Using the Python API | |||||||
Run python code with:
PYTHONPATH=build/shared-release LD_LIBRARY_PATH=build/shared-release | ||||||||
Changed: | ||||||||
< < | (This enables Python to find the mupdf module, and enables the system dynamic linker to find the shared libraries that implement the underlying C, C++ and Python MuPDF APIs.) | |||||||
> > | (This enables Python to find the mupdf module, and enables the system dynamic linker to find the shared libraries that implement the underlying C, C++ and Python MuPDF APIs.) | |||||||
Changed: | ||||||||
< < | Example Python code: | |||||||
> > | Minimal example Python code: | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | ||||||||
import mupdf | ||||||||
Changed: | ||||||||
< < | document = mupdf.Document("foo.pdf") | |||||||
> > | document = mupdf.Document('foo.pdf') | |||||||
Detailed usage of the Python API can be found in: | ||||||||
Line: 76 to 95 | ||||||||
| ||||||||
Changed: | ||||||||
< < | How the build works: | |||||||
> > | How the build works | |||||||
Changed: | ||||||||
< < | Building of MuPDF shared library: | |||||||
> > | Building of MuPDF shared library: | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | mupdfwrap.py 's generation of the C++ MuPDF API: | |||||||
> > | Generation of the C++ MuPDF API: | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < | mupdfwrap.py 's generation of the Python MuPDF API: | |||||||
> > | Generation of the Python MuPDF API: | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | Generated files: | |||||||
> > | Generated files | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | ||||||||
mupdf/ build/ | ||||||||
Changed: | ||||||||
< < | shared-release/ [Files needed at runtime.] | |||||||
> > | shared-release/ [Files needed at runtime] | |||||||
libmupdf.so [implements C MuPDF API] libmupdfcpp.so [implements C++ MuPDF API] mupdf.py [implements Python MuPDF API] | ||||||||
Line: 119 to 136 | ||||||||
exceptions.h functions.h internal.h | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Other internal generated files: | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > | ||||||||
mupdf/ build/ platform/ c++/ implementation/ | ||||||||
Changed: | ||||||||
< < | *.cpp [MuPDF C++ implementation.] | |||||||
> > | *.cpp [MuPDF C++ implementation] | |||||||
python/ | ||||||||
Changed: | ||||||||
< < | [SWIG files.] | |||||||
> > | [SWIG files] | |||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Please send any questions, comments or suggestions about this page to: julian.smith@artifex.com | ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
C++ and Python APIs for MuPDF.Overview:The C++ MuPDF API:
The Python MuPDF API:
Building the C++ and Python MuPDF APIs:We require:
scripts/mupdfwrap.py script.
Build C++ and Python MuPDF APIs and run basic tests with:
cd mupdf ./scripts/mupdfwrap.py -b all -tDebug build: cd mupdf ./scripts/mupdfwrap.py -d build/shared-debug -b all -tFor more details, run ./scripts/mupdfwrap.py -h to see help, or look at the doc-string at beginning of the script directly.
Using the Python API:Run python code with:PYTHONPATH=build/shared-release LD_LIBRARY_PATH=build/shared-release
(This enables Python to find the mupdf module, and enables the system dynamic linker to find the shared libraries that implement the underlying C, C++ and Python MuPDF APIs.)
Example Python code:
import mupdf document = mupdf.Document("foo.pdf")Detailed usage of the Python API can be found in:
How the build works:Building of MuPDF shared library:
mupdfwrap.py 's generation of the C++ MuPDF API:
mupdfwrap.py 's generation of the Python MuPDF API:
Generated files:mupdf/ build/ shared-release/ [Files needed at runtime.] libmupdf.so [implements C MuPDF API] libmupdfcpp.so [implements C++ MuPDF API] mupdf.py [implements Python MuPDF API] _mupdf.so [implements Python MuPDF API internals] shared-debug/ [as shared-release but debug build] platform/ c++/ include/ mupdf/ [C++ MuPDF API] classes.h exceptions.h functions.h internal.hOther internal generated files: mupdf/ build/ platform/ c++/ implementation/ *.cpp [MuPDF C++ implementation.] python/ [SWIG files.] Please send any questions, comments or suggestions about this page to: julian.smith@artifex.com |