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

Method getMetadata

src/api/pdf.ts:1447–1460  ·  view source on GitHub ↗

* Get all document metadata. * * @returns Object containing all metadata fields * * @example * ```typescript * const metadata = pdf.getMetadata(); * console.log(`Title: ${metadata.title}`); * console.log(`Author: ${metadata.author}`); * ```

()

Source from the content-addressed store, hash-verified

1445 * ```
1446 */
1447 getMetadata(): DocumentMetadata {
1448 return {
1449 title: this.getTitle(),
1450 author: this.getAuthor(),
1451 subject: this.getSubject(),
1452 keywords: this.getKeywords(),
1453 creator: this.getCreator(),
1454 producer: this.getProducer(),
1455 creationDate: this.getCreationDate(),
1456 modificationDate: this.getModificationDate(),
1457 trapped: this.getTrapped(),
1458 language: this.getLanguage(),
1459 };
1460 }
1461
1462 /**
1463 * Set multiple metadata fields at once.

Callers 3

pdf.test.tsFile · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 10

getTitleMethod · 0.95
getAuthorMethod · 0.95
getSubjectMethod · 0.95
getKeywordsMethod · 0.95
getCreatorMethod · 0.95
getProducerMethod · 0.95
getCreationDateMethod · 0.95
getModificationDateMethod · 0.95
getTrappedMethod · 0.95
getLanguageMethod · 0.95

Tested by

no test coverage detected