Many functions in MuPDF take a generic set of options to customize behavior in an extensible manner.
These options strings may use any one of the three supported syntaxes to represent key-value pairs.
Boolean values can be represented in several equivalent ways:
An option with an empty value counts as true.
Classic syntax with comma-separated key-value pairs.
Values may be enclosed in double quotes to allow embedding commas and equal signs. To represent a double quote within a quoted value, use two double quotes in a row.
compress,encrypt=aes-256,owner-password="Hello, ""world""!"
If the option string starts with a question mark, it will be parsed using URL query string syntax.
?compress=true&encrypt=aes-256&owner-password=Hello,%20%22world%22%21
Encode special characters using %HH hexadecimal
escapes.
The string can also be in a subset of JSON – a single JSON object containing only booleans, numbers, strings, and arrays of numbers.
{"compress":true,"encrypt":"aes-256","owner-password":"Hello, \"world\"!"}
Escape double quotes and backslashes with a backslash.