mPDF Manual – mPDF functions

Overview

mPDF Functions by Category

Main controls

mPDF - Main class constructor

mPDFI - [Depracated] - see SetImportUse()

WriteHTML - Write HTML code to the document

Output - Finalise the document and send it to specified destination

Configuration

SetImportUse - Enables use of templates and imported PDF files (was mPDFI)

StartProgressBarOutput - Show progress bars whilst generating PDF file

SetAnchor2Bookmark - Specifies how PDF Book marks are created from HTML anchors

SetBasePath - Specifies a base URL for mPDF to interpret relative URLs

SetCompression - Specifies that mPDF should compress the data for the PDF file

SetDefaultFont -

SetDefaultBodyCSS -

SetDefaultFontSize -

SetDirectionality -

SetDisplayMode - Specify the initial Display Mode when the PDF file is opened

SetAutoFont -

RestrictUnicodeFonts -

SetUserRights -

Document Metadata

SetTitle - Set the document title

SetAuthor - Set the document author

SetCreator - Set the document creator

SetSubject - Set the document subject

SetKeywords - Set the document keywords

Encryption & Passwords

SetProtection - Encrypts and sets the PDF document permissions

SetUserRights -

Watermarks (page backgrounds)

SetWatermarkImage - Set an image to use as a Watermark

SetWatermarkText - Set the text to use as a Watermark

Page Numbering

AliasNbPages -Defines the placeholder used to insert total number of pages into the document

AliasNbPageGroups -Defines the placeholder used to insert total page number into the document

Colours

AddSpotColor - Define a Spot Colour to be referenced in the document

The following methods have HTML equivalents e,g, <pagebreak /> and AddPage():

Paging

AddPage - Add a new page

AddPageByArray - Add a new page using array of parameters

Bookmarks (Outlines)

Bookmark -Add a Bookmark to the document

Annotations

Annotation -Add an Annotation to the document

Index

CreateIndex -Generate an Index for the document (mPDF < v6.0)

InsertIndex - Generate an Index for the document (mPDF >= v6.0)

IndexEntry -Insert an Index entry for the document

IndexEntrySee - Insert a cross-reference entry for the document Index

Columns

SetColumns -Control the use of multiple columns on the page

AddColumn - Start a new Column

Page Headers & Footers

DefFooterByName - Define a page footer by name

DefHeaderByName - Define a page header by name

DefHTMLFooterByName - Define an HTML page footer by name

DefHTMLHeaderByName - Define an HTML page header by name

SetFooter - Set a page footer

SetFooterByName - Set a page footer by name

SetHeader - Set a page header

SetHeaderByName - Set a page header by name

SetHTMLFooter - Set an HTML page footer

SetHTMLFooterByName - Set an HTML page footer by name

SetHTMLHeader - Set an HTML page header

SetHTMLHeaderByName - Set an HTML page header by name

Table of Contents

TOCpagebreak - Insert a table of contents in the document

TOCpagebreakByArray - Insert a table of contents in the document using an array of parameters

TOC_Entry - Insert an entry for the Table of Contents

Other Miscellaneous methods:

Replacing text in existing PDF files

OverWrite - Replace specified text strings in an existing PDF file

Control Visibility

SetVisibility - Control the visibility of subsequent objects

Import PDF files & Templates

mPDFI - [Depracated] - see SetImportUse()

Thumbnail - Print thumbnails of an external PDF file

SetSourceFile - Specify the source PDF file used to import pages into the document

ImportPage - Import a page from an external PDF file

UseTemplate - Insert an imported page from an external PDF file

SetPageTemplate - Specify a page from an external PDF file to use as a template

SetDocTemplate - Specify an external PDF file to use as a template

Barcode

WriteBarcode - Write an EAN-13 (ISBN-13) barcode

Write directly to page without HTML

AutosizeText -

RoundedRect -

WriteCell -

WriteText -

Shaded_box -

CircularText - NB This does have an HTML equivalent as <textcircle>