A PDF file contains metadata about the title, author, subject, creation date, keywords. The title is usually shown in the top of the screen when a user views the file; the rest of the metadata can be accessed by viewing Document properties in Adobe Reader.
You can set the metadata directly using:
Metadata is also set automatically if you pass full HTML code to WriteHTML() including:
- title is read from <title>...</title> tags
- subject, keywords and author are read from <meta ... /> tags
Whichever is set later will override previous settings.
The text should be UTF-8 encoded, but should not contain HTML mark-up tags. strcode2utf() is a useful function provided with mPDF which converts HTML numerical entities to UTF-8 encoded string.
- SetTitle() - Set document Title in metadata
- SetAuthor() - Set document Author in metadata
- SetCreator() - Set document Creator in metadata
- SetSubject() - Set document Subject in metadata
- SetKeywords() - Set document Keywords in metadata
- strcode2utf() - Convert HTML numerical entities to UTF-8 encoded string