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

Method createDict

src/api/pdf.ts:1980–1992  ·  view source on GitHub ↗

* Create and register a new dictionary.

(entries?: Record<string, PdfObject> | [string, PdfObject][])

Source from the content-addressed store, hash-verified

1978 * Create and register a new dictionary.
1979 */
1980 createDict(entries?: Record<string, PdfObject> | [string, PdfObject][]): PdfRef {
1981 let dict: PdfDict;
1982
1983 if (Array.isArray(entries)) {
1984 dict = new PdfDict(entries);
1985 } else if (entries) {
1986 dict = PdfDict.of(entries);
1987 } else {
1988 dict = new PdfDict();
1989 }
1990
1991 return this.register(dict);
1992 }
1993
1994 /**
1995 * Create and register a new array.

Callers 4

createShadingPatternMethod · 0.45
createExtGStateMethod · 0.45
pdf.test.tsFile · 0.45
registerGraphicsStateMethod · 0.45

Calls 2

registerMethod · 0.95
ofMethod · 0.45

Tested by

no test coverage detected