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

Method from

src/content/content-stream.ts:36–41  ·  view source on GitHub ↗

* Create a builder from an array of operators. * Convenient for building content streams declaratively. * * @example * ```ts * const content = ContentStreamBuilder.from([ * pushGraphicsState(), * setLineWidth(2), * moveTo(0, 0), * lineTo(100, 100), * stroke(),

(operators: Operator[])

Source from the content-addressed store, hash-verified

34 * ```
35 */
36 static from(operators: Operator[]): ContentStreamBuilder {
37 const builder = new ContentStreamBuilder();
38 builder.operators.push(...operators);
39
40 return builder;
41 }
42
43 /**
44 * Add one or more operators.

Callers 15

toHexStringFunction · 0.80
toAsciiStringFunction · 0.80
createMethod · 0.80
generateRandomPasswordFunction · 0.80
scanForObjectsMethod · 0.80
math.test.tsFile · 0.80
getGlyphNamesMethod · 0.80
assertNoDanglingRefsFunction · 0.80
pdf-writer.test.tsFile · 0.80
form-font.test.tsFile · 0.80

Calls 1

pushMethod · 0.80

Tested by 1

assertNoDanglingRefsFunction · 0.64