MCPcopy Create free account
hub / github.com/LibPDF-js/core / setTitle

Method setTitle

src/api/pdf.ts:1088–1094  ·  view source on GitHub ↗

* Set the document title. * * @param title - The document title * @param options - Additional options (e.g., showInWindowTitleBar) * * @example * ```typescript * pdf.setTitle("Quarterly Report Q4 2024"); * * // Show title in viewer's title bar instead of filename * pdf.

(title: string, options?: SetTitleOptions)

Source from the content-addressed store, hash-verified

1086 * ```
1087 */
1088 setTitle(title: string, options?: SetTitleOptions): void {
1089 this.getInfoDict().set("Title", PdfString.fromString(title));
1090
1091 if (options?.showInWindowTitleBar) {
1092 this.getOrCreateViewerPreferences().set("DisplayDocTitle", PdfBool.of(true));
1093 }
1094 }
1095
1096 /**
1097 * Get the document author.

Callers 11

setMetadataMethod · 0.95
pdf.test.tsFile · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 5

getInfoDictMethod · 0.95
setMethod · 0.45
fromStringMethod · 0.45
ofMethod · 0.45

Tested by

no test coverage detected