* 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[])
| 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. |