Description
Sets the font to use for the title or item in the table of contents.
Applies to
Syntax
SetFont(PDFFont font)
Return value
None.
Usage
Call the function to set the font to use for the title or items in the table of contents.
If no font is set for a PDFTableOfContentsItem object, the object will try to use the font from its immediate upper level, and then the next upper level, ..., until it gets the font of PDFTableOfContents. If no font is set for the PDFTableOfContents object, the object uses the default of the PDF document.
Examples
This example sets the font style for the titles in the table of contents.
lpdf_toc = create PDFtableofcontents lpdf_font = create PDFfont lpdf_font.fontname = "Microsoft YaHei" lpdf_font.bold = true lpdf_font.italic = true lpdf_font.fontsize = 20 lpdf_toc.setfont( lpdf_font)
This example sets the font style for an item in the table of contents.
lpdf_tocitem = lpdf_toc.additem( lpdf_chapter) lpdf_font.fontname = "Microsoft YaHei" lpdf_font.bold = true lpdf_font.italic = true lpdf_font.fontsize = 20 lpdf_tocitem.setfont( lpdf_font)
See also