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

Method registerGraphicsState

src/api/pdf-page.ts:2650–2655  ·  view source on GitHub ↗

* Create and register a graphics state, returning its resource name. * * This is an internal helper for high-level drawing methods. * For the public low-level API, use `pdf.createExtGState()` + `page.registerExtGState()`.

(options: { fillOpacity?: number; strokeOpacity?: number })

Source from the content-addressed store, hash-verified

2648 * For the public low-level API, use `pdf.createExtGState()` + `page.registerExtGState()`.
2649 */
2650 private registerGraphicsState(options: { fillOpacity?: number; strokeOpacity?: number }): string {
2651 const dict = PDFExtGState.createDict(options);
2652 const ref = this.ctx.register(dict);
2653
2654 return this.registerExtGState({ type: "extgstate", ref });
2655 }
2656
2657 /**
2658 * Append operators to the page content stream (foreground).

Callers 9

drawPageMethod · 0.95
drawRectangleMethod · 0.95
drawLineMethod · 0.95
drawCircleMethod · 0.95
drawEllipseMethod · 0.95
drawTextMethod · 0.95
drawImageMethod · 0.95
drawPathMethod · 0.95
paintMethod · 0.80

Calls 3

registerExtGStateMethod · 0.95
createDictMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected