File: functions.rst

package info (click to toggle)
mupdf 1.27.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,224 kB
  • sloc: ansic: 335,320; python: 20,906; java: 7,520; javascript: 2,213; makefile: 1,152; xml: 675; cpp: 639; sh: 513; cs: 307; awk: 10; sed: 7; lisp: 3
file content (60 lines) | stat: -rw-r--r-- 1,627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.. default-domain:: js

.. highlight:: javascript

Functions
=========

Most functionality is provided by member functions of class objects.
There are just a couple of top level configuration functions listed
here.

.. function:: mupdf.installLoadFontFunction(callback)

	Install a handler to load system (or missing) fonts.

	The callback function will be called with four arguments:

	.. code-block::

		callback(fontName, scriptName, isBold, isItalic)

	The callback should return either a `Font` object for the requested
	font, or ``null`` if an exact match cannot be found (so that the font
	loading machinery can keep looking through the chain of fallback
	fonts).

.. function:: mupdf.enableICC()

	Enable ICC-profiles based operation.

.. function:: mupdf.disableICC()

	Disable ICC-profiles based operation.

.. function:: mupdf.emptyStore()

	Empty all cached entries from the store.

.. function:: mupdf.shrinkStore(percent)

	Remove cached entries from the store until it holds less
	data than the specified threshold.

	If the store was initialized with a limit, the threshold is a
	percentage of the limit. If the store is unlimited in size, the
	threshold is a percentage of what the store currently holds.

	Returns a boolean indicating whether or not the store was able to be
	shrunk to below the threshold.

	:param number percent:
	:returns: boolean

.. function:: mupdf.setUserCSS(stylesheet, useDocumentStyles)

	Set a style sheet to apply to all reflowable documents.

	:param string stylesheet: The CSS text to use.
	:param boolean useDocumentStyles:
		Whether to respect the document's own style sheet.