Object Protocols¶
The following objects are standard JavaScript objects with assumed properties (i.e. they follow their outlined protocol). They are used throughout the mutool API to support object types for various methods.
Link Destination Object¶
A link destination points to a location within a document and how a document viewer should show that destination.
It consists of a dictionary with keys for:
chapterThe chapter within the document.
pageThe page within the document.
typeEither “Fit”, “FitB”, “FitH”, “FitBH”, “FitV”, “FitBV”, “FitR” or “XYZ”, controlling which of the keys below exist.
xThe left coordinate, valid for “FitV”, “FitBV”, “FitR” and “XYZ”.
yThe top coordinate, valid for “FitH”, “FitBH”, “FitR” and “XYZ”.
widthThe width of the zoomed in region, valid for “XYZ”.
heightThe height of the zoomed in region, valid for “XYZ”.
zoomThe zoom factor, valid for “XYZ”.
File Specification Object¶
This object is used to represent a file.
In order to retrieve information from this object see methods described within Embedded files in PDFs.
Embedded File Object¶
This Object contains metadata about an embedded file, it has properties for:
filenameThe name of the embedded file.
mimetypeThe MIME type of the embedded file, or
undefinedif none exists.sizeThe size in bytes of the embedded file contents.
creationDateThe creation date of the embedded file.
modificationDateThe modification date of the embedded file.
PDF Journal Object¶
This Object contains a numbered array of operations and a reference into this list indicating the current position.
positionThe current position in the journal.
stepsAn array containing the name of each step in the journal.
Stroking State Object¶
The stroking state is a dictionary with keys for:
startCap,dashCap,endCap“Butt”, “Round”, “Square”, or “Triangle”.
lineCapSet
startCap,dashCap, andendCapall at once.
lineJoin“Miter”, “Round”, “Bevel”, or “MiterXPS”.
lineWidthThickness of the line.
miterLimitMaximum ratio of the miter length to line width, before beveling the join instead.
dashPhaseStarting offset for dash pattern.
dashesArray of on/off dash lengths.
EXAMPLE
{dashes:[5,10], lineWidth:3, lineCap:'Round'}
Outline Iterator Object¶
This Object has properties for:
titleThe title of the item.
uriA URI pointing to the destination. Likely to be a document internal link that can be resolved by Document.resolveLink(), otherwise a link to a web page.
openTrue if the item should be opened when shown in a tree view.
Text Layout Object¶
A description of layouted text value from a text widget with keys:
matrixNormal transform matrix for the layouted text.
invMatrixInverted transform matrix for the layouted text.
linesAn array of text lines belonging to the layouted text, a
linesobject contains:xThe X coordinate for the text line.yThe Y coordinate for the text line.fontSizeThe text size used for the layouted text line.indexThe index of the beginning of the line in the text string.rectThe bounding rectangle for the text line.charsAn array of characters in the text line.
Signature Configuration Object¶
A signature configuration object has properties with Boolean values as follows:
showLabelsWhether to include both labels and values or just values on the right hand side.
showDNWhether to include the distinguished name on the right hand side.
showTextNameWhether to include the name of the signatory on the right hand side.
showDateWhether to include the date of signing on the right hand side.
showGraphicNameWhether to include the signatory name on the left hand side.
showLogoWhether to include the MuPDF logo in the background.
Placement Result Object¶
filledThe rectangle of the actual area that was used.
moreTrue if more content remains to be placed, otherwise false if all content fits in the
Story.
Default Appearance Text Object¶
fontString representing the font.
sizeInteger representing the size of the font.
colorArray representing the color value.