### SDO Installation Guide Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt Instructions and information regarding the installation of SDO. ```html
This page details the steps and prerequisites for installing SDO.
<!-- Installation commands or procedures would go here, but are not provided in the source -->
```
--------------------------------
### SDO Setup Guide
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Instructions on how to set up and prepare your environment for using SDO.
```html
This page guides you through the setup process for SDO.
<!-- Setup instructions or code snippets would go here, but are not provided in the source -->
```
--------------------------------
### Parle Installation Guide
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Provides instructions and information on how to install the Parle library. This is essential for setting up the project.
```html
file class=normal space=compressed size=2851 read=2851 sha1=cf561bc1af02af52d6db4442e378708d56fd0d0d status=ok path=/res/parle.installation.html
```
--------------------------------
### SDO Sample: Get/Set Example
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Demonstrates basic get and set operations on SDO data.
```html
This page shows examples of getting and setting data using SDO.
<!-- Get/Set examples would go here, but are not provided in the source -->
```
--------------------------------
### Parle Examples Overview
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Provides an overview and examples of how to use the Parle library. This is a good starting point for understanding its usage.
```html
file class=normal space=compressed size=1503 read=1503 sha1=44b34b03277c02e0bd165731ad9ef700525a9d57 status=ok path=/res/parle.examples.html
```
--------------------------------
### HTML Start Tag Example
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
Illustrates the basic structure of an HTML start tag, including the tag name and optional attributes.
```html
```
--------------------------------
### SHMOP Setup
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Setup instructions for SHMOP.
```html
Instructions for setting up SHMOP.
``` -------------------------------- ### Update Info File Structure (Installer) Source: https://github.com/sumatrapdfreader/sumatrapdf/wiki/Enabling-auto-updates Example structure for the 'update-info.txt' file, detailing information for an installer build, including its URL and SHA-256 hash. This can be used alongside or instead of the 'Portable' section. ```ini [SumatraPDF] Latest 2.6 Installer [ URL: http://www.example.net/SumatraPDF-install.exe Hash 5397e57f28b86f9f8be18668e96d83a86ba813b3a43ef4e06ae1e726dd1cc236 ] ``` -------------------------------- ### Install the Project Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/freetype/CMakeLists.txt This command installs the built project. It can be prefixed with 'sudo' for system-wide installation. ```bash (sudo) cmake --build build --target install ``` -------------------------------- ### Build Python SWIG Bindings for libwebp Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/libwebp/swig/README.md Build and install the Python SWIG bindings for libwebp. This involves running the setup script with build and install commands. ```shell $ python setup.py build_ext $ python setup.py install --prefix=pylocal ``` -------------------------------- ### SDO Examples Overview Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt An overview page for various SDO examples. ```htmlThis page serves as an entry point to different SDO examples.
<!-- Links to various SDO examples would be here, but are not provided in the source -->
```
--------------------------------
### Session Setup Configuration
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Configuration file for session setup.
```html
Details for setting up user sessions.
``` -------------------------------- ### SHMOP Installation Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt Instructions for installing SHMOP. ```htmlSteps required to install SHMOP.
``` -------------------------------- ### Install HTML Documentation Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/openjpeg/doc/CMakeLists.txt This command installs the generated HTML documentation directory to the specified installation destination. It also excludes any version control directories. ```cmake install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html DESTINATION ${CMAKE_INSTALL_DOCDIR} PATTERN ".svn" EXCLUDE ) ``` -------------------------------- ### Install zlib Libraries and Headers Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/zlib-ng/CMakeLists.txt Installs the zlib target, headers, and pkg-config file based on installation skip flags. ```cmake if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) install(TARGETS ${ZLIB_INSTALL_LIBRARIES} RUNTIME DESTINATION "${BIN_INSTALL_DIR}" ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" LIBRARY DESTINATION "${LIB_INSTALL_DIR}") endif() if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL) install(FILES zlib${SUFFIX}.h DESTINATION "${INC_INSTALL_DIR}" RENAME zlib${SUFFIX}.h) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zconf${SUFFIX}.h DESTINATION "${INC_INSTALL_DIR}" RENAME zconf${SUFFIX}.h) endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) install(FILES ${ZLIB_PC} DESTINATION "${PKGCONFIG_INSTALL_DIR}") endif() ``` -------------------------------- ### Install MuPDF System Wide Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/guide/install.md Install MuPDF binaries, libraries, and headers system-wide using 'make install'. ```bash make prefix=/usr/local install ``` -------------------------------- ### Install sharpyuv Library and Headers Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/libwebp/CMakeLists.txt Configures the installation of the 'sharpyuv' library, including its headers, archives, libraries, and runtime binaries, to standard installation directories. ```cmake install( TARGETS sharpyuv EXPORT ${PROJECT_NAME}Targets PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webp/sharpyuv INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/webp ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### SHMOP Examples Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt General examples for SHMOP usage. ```htmlVarious examples illustrating SHMOP functionality.
``` -------------------------------- ### Build and Install with Autoconf Tools Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/libwebp/doc/building.md Generates the configure script, builds, and installs libwebp using autoconf tools. This process installs header files, libraries, and binaries to /usr/local. ```shell ./configure make make install ``` -------------------------------- ### Install Brotli using Vcpkg Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/brotli/README.md Use the vcpkg dependency manager to download and install the brotli library. Ensure vcpkg is bootstrapped and integrated with your system before installing. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install brotli ``` -------------------------------- ### SimpleXML Basic Examples Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt Basic usage examples for SimpleXML. ```htmlDemonstrates fundamental SimpleXML operations.
<?php
$xmlString = "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>";
$xml = simplexml_load_string($xmlString);
print_r($xml);
?>
```
--------------------------------
### Optional HTML Start Tag Example
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
Shows an example where the start tag can be omitted if it's the first element and not preceded by a comment. The DOM remains the same.
```html
Welcome to this example.
``` -------------------------------- ### Enable and Start QEMU User Static Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/zlib-ng/arch/s390/README.md Enables and starts the qemu-user-static service for x86_64 emulation. ```bash sudo systemctl enable --now qemu-user-static ``` -------------------------------- ### Run Example Swing Viewer Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/guide/using-with-java.md Build and run the example Swing viewer application. This requires navigating to the Java platform directory. ```bash make -C platform/java run ``` -------------------------------- ### SDO Basic Examples Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt Illustrates fundamental usage patterns and examples for SDO. ```htmlThis page contains basic examples demonstrating SDO functionality.
<!-- Basic SDO code examples would go here, but are not provided in the source -->
```
--------------------------------
### HTML Form with GET Submission
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
Example of an HTML form that uses the GET method for submission. User input is appended to the URL as query parameters.
```html
```
--------------------------------
### HTML Form with GET Method
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
This example demonstrates using the 'method="get"' attribute on a form to submit search queries in the URL.
```html
```
--------------------------------
### mb_ereg_search_pos
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Gets the start and length of the current regular expression match.
```APIDOC
## mb_ereg_search_pos
### Description
Gets the start and length of the current regular expression match.
### Method
`mb_ereg_search_pos()`
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- None
### Request Example
```php
mb_ereg_search_pos();
```
### Response
#### Success Response (array)
Returns an array containing the start position and length of the match, or `false` if no match is found.
#### Response Example
```json
{
"example": [0, 5]
}
```
```
--------------------------------
### Start Simple Viewer with HTTP Server
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/platform/wasm/examples/simple-viewer/README.md
Use this command to start the HTTP server and open the simple viewer in your browser. Ensure you are in the correct directory.
```bash
npx http-server ../.. -b -o examples/simple-viewer
```
--------------------------------
### Open Document Examples
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/reference/javascript/types/Document.rst
Demonstrates various ways to open documents using file names, buffers, and accelerator files.
```javascript
var document1 = mupdf.Document.openDocument("my_pdf.pdf", "application/pdf")
```
```javascript
var document2 = mupdf.Document.openDocument("my_pdf.pdf", dir)
```
```javascript
var document3 = mupdf.Document.openDocument("my_pdf.pdf", acceleratorfile, dir)
```
```javascript
var document4 = mupdf.Document.openDocument(fs.readFileSync("my_pdf.pdf"), "application/pdf")
```
```javascript
var document5 = mupdf.Document.openDocument(fs.readFileSync("my_pdf.pdf"), acceleratorbuffer, "application/pdf")
```
```javascript
var document6 = mupdf.Document.openDocument(fs.readFileSync("my_pdf.pdf"), acceleratorbuffer, dir, "application/pdf")
```
--------------------------------
### Example External Viewer Configuration (Foxit Reader)
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/docs/md/Customize-external-viewers.md
An example demonstrating how to configure Foxit Reader as an external viewer. It includes the command line, display name, file filter, keyboard shortcut, and toolbar text.
```ini
ExternalViewers [
[
CommandLine = "C:\Program Files\FoxitReader\FoxitReader.exe" /A page=%p "%1"
Name = Foxit &Reader
Filter = *.pdf
Key = Ctrl + m
ToolbarText = Foxit
]
]
```
--------------------------------
### Get Annotation Line Ending Styles
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/reference/javascript/types/PDFAnnotation.rst
Retrieves the line ending styles for the start and end of a line annotation. Returns an object with 'start' and 'end' string properties.
```javascript
var lineEndingStyles = annotation.getLineEndingStyles()
```
--------------------------------
### Sockets Setup HTML
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
HTML file describing the setup process for the sockets library.
```html
sockets
This document describes the setup process for the sockets library.
The following are the setup steps:
1. Ensure you have PHP installed.
2. Enable the sockets extension in your php.ini file.
3. Restart your web server.
```
--------------------------------
### Get Number of MIME Types
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
Retrieves the total count of MIME types supported by the installed plugins.
```javascript
window.navigator.mimeTypes.length
```
--------------------------------
### Configure and Build zlib-ng
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/zlib-ng/README.md
Use the configure script to set up the build environment, followed by make to compile and make test to run tests. Ensure you are in the zlib-ng source directory before running these commands.
```bash
./configure
make
make test
```
--------------------------------
### Get Number of Components in ColorSpace
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/reference/javascript/types/ColorSpace.rst
Retrieves the number of color components for a given ColorSpace. For example, DeviceRGB has 3 components.
```javascript
var cs = mupdf.ColorSpace.DeviceRGB
var num = cs.getNumberOfComponents() // 3
```
--------------------------------
### Sodium Setup HTML
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
HTML file describing the setup process for the Sodium library.
```html
sodium
This document describes the setup process for the Sodium library.
The following are the setup steps:
1. Install the libsodium library.
2. Install the PHP Sodium extension.
3. Enable the sodium extension in your php.ini file.
4. Restart your web server.
```
--------------------------------
### Get Dash Phase
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/reference/javascript/types/StrokeState.rst
Retrieves the dash phase setting from a StrokeState object. This indicates the starting point within the dash pattern.
```javascript
var limit = strokeState.getDashPhase()
```
--------------------------------
### Check if Search Provider Installed Example
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
Checks if a search provider matching the given URL is installed. Returns 0, 1, or 2 based on the match and default status. URL comparison uses a prefix match against results pages on the same domain.
```javascript
installed = window.external.IsSearchProviderInstalled(url)
```
--------------------------------
### Install libwebp using vcpkg
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/libwebp/doc/building.md
Download, bootstrap, and install libwebp using the vcpkg dependency manager. This is a convenient way to manage the library and its dependencies.
```shell
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install libwebp
```
--------------------------------
### Start Local HTTP Server and Open Viewer
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/platform/wasm/examples/super-simple-viewer/README.md
Use this command to start a local HTTP server and automatically open the super-simple-viewer in your browser. This is necessary to serve the HTML and JavaScript files for the viewer.
```bash
npx http-server ../.. -b -o examples/super-simple-viewer
```
--------------------------------
### Get Annotation Line Endpoints
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/reference/javascript/types/PDFAnnotation.rst
Retrieves the start and end points of a line annotation. The points are returned as an array of two [x, y] arrays.
```javascript
var line = annotation.getLine()
```
--------------------------------
### Basic Ruby Annotation Example
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
Demonstrates a simple ruby element with a single base character and its annotation. This is useful for basic pronunciation guides.
```html
B
```
--------------------------------
### WebVTT File Example for Nested Chapters
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html
This WebVTT file demonstrates how to structure nested chapters with start and end times, and titles. It includes main chapters and their respective subchapters.
```WebVTT
WEBVTT
00:00:00.000 --> 00:50:00.000
Astrophysics
00:00:00.000 --> 00:10:00.000
Introduction to Astrophysics
00:10:00.000 --> 00:45:00.000
The Solar System
00:00:00.000 --> 00:10:00.000
Coursework Description
00:50:00.000 --> 01:40:00.000
Computational Physics
00:50:00.000 --> 00:55:00.000
Introduction to Programming
00:55:00.000 --> 01:30:00.000
Data Structures
01:30:00.000 --> 01:35:00.000
Answers to Last Exam
01:35:00.000 --> 01:40:00.000
Coursework Description
01:40:00.000 --> 02:30:00.000
General Relativity
01:40:00.000 --> 02:00:00.000
Tensor Algebra
02:00:00.000 --> 02:30:00.000
The General Relativistic Field Equations
```
--------------------------------
### img2webp Example Usage
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/libwebp/doc/tools.md
An example demonstrating how to combine file and per-frame options to create an animated WebP file with specific loop count, lossy compression for one frame, and custom duration for another.
```shell
img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp
```
--------------------------------
### Install Python Bindings using setup.py (OpenBSD)
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/docs/reference/cxx-and-derived-bindings.rst
Build and install the Python bindings for MuPDF on OpenBSD by directly running setup.py. This is a workaround for missing libclang on PyPI.
```shell
cd mupdf && setup.py install
```
--------------------------------
### Format Brotli Code
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/brotli/python/README.md
Automatically format all Python files in the brotli project using YAPF, adhering to the Google Python Style Guide. Ensure YAPF is installed first.
```bash
$ pip install yapf
```
```bash
$ make fix
```
--------------------------------
### Compile and Run JNI libwebp Example
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/libwebp/swig/README.md
Commands to compile the Java example and run it, ensuring the native library path is correctly set.
```shell
$ javac -cp libwebp.jar libwebp_jni_example.java
$ java -Djava.library.path=. -cp libwebp.jar:. libwebp_jni_example
```
--------------------------------
### Embed MuJS Interpreter
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/mujs/docs/examples.html
This example shows how to create a new MuJS state, read strings from standard input, execute them, and then free the state. It's a basic setup for an interactive interpreter.
```c
#include
This smells of lemons!
``` -------------------------------- ### Premake Configuration Files Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/docs/md/Build-system.md Lists the relevant .lua files for Premake configuration in the project root. ```shell PS C:\Users\kjk\src\sumatrapdf> ls *.lua Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 4/24/2020 12:20 AM 22947 premake5.files.lua -a---- 5/4/2020 7:51 PM 23565 premake5.lua ``` -------------------------------- ### Set and Get sessionStorage Data Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/gumbo-parser/benchmarks/html5_spec.html Use sessionStorage to store data specific to a single browser window. Data persists as long as the window is open. This example shows how to set a value based on a checkbox state and later check if it exists. ```html ``` ```javascript if (sessionStorage.insurance) { ... } ``` -------------------------------- ### Install OpenJPEG Headers Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/openjpeg/src/lib/openjp2/CMakeLists.txt Installs the openjpeg.h header file to the specified installation directory. This is part of the Headers component for installation. ```cmake install(FILES openjpeg.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers ) ``` -------------------------------- ### Install HarfBuzz Headers Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/ext/harfbuzz/CMakeLists.txt Installs HarfBuzz header files to the system's include directory. This is conditional on not skipping header installation and not skipping all installations. ```cmake install(FILES ${project_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/harfbuzz) if (HB_HAVE_GOBJECT) install(FILES ${hb_gobject_headers} ${hb_gobject_gen_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/harfbuzz) endif () ``` -------------------------------- ### SDO Sample: Reflection Example Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt Illustrates how to use reflection with SDO. ```htmlThis page demonstrates reflection capabilities within SDO.
<!-- Reflection examples would go here, but are not provided in the source -->
```
--------------------------------
### eio_init
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/tests/chm-dump-all-baseline.txt
Initializes the Eio library.
```APIDOC
## eio_init
### Description
Initializes the Eio library. This function must be called before using any other Eio functions.
### Method
N/A (Function call)
### Endpoint
N/A
### Parameters
* **nthreads** (int) - Required - The number of worker threads to create.
* **max_parallel** (int) - Required - The maximum number of parallel requests.
### Request Example
```c
eio_init(4, 100);
```
### Response
#### Success Response (int)
Returns `0` on success, or a negative error code on failure.
#### Response Example
```json
0
```
```
--------------------------------
### Install Emscripten SDK
Source: https://github.com/sumatrapdfreader/sumatrapdf/blob/master/mupdf/platform/wasm/BUILDING.md
Installs and activates a specific version of the Emscripten SDK. Ensure the path matches your installation or update `tools/build.sh`.
```bash
/opt/emsdk/emsdk install 4.0.8
/opt/emsdk/emsdk activate 4.0.8
```