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

Method createFormXObject

src/api/pdf.ts:2488–2495  ·  view source on GitHub ↗

* Create a Form XObject (reusable content). * * @param options - Form XObject options including bbox and operators * @returns PDFFormXObject resource for use with page.registerXObject() * * @example * ```typescript * const stamp = pdf.createFormXObject({ * bbox: { x: 0, y:

(options: FormXObjectOptions)

Source from the content-addressed store, hash-verified

2486 * ```
2487 */
2488 createFormXObject(options: FormXObjectOptions): PDFFormXObject {
2489 const contentBytes = serializeOperators(options.operators);
2490 const stream = PDFFormXObject.createStream(options, contentBytes);
2491
2492 const ref = this.register(stream);
2493
2494 return new PDFFormXObject(ref, options.bbox);
2495 }
2496
2497 // ─────────────────────────────────────────────────────────────────────────────
2498 // Attachments

Callers 2

factory.test.tsFile · 0.80

Calls 3

registerMethod · 0.95
serializeOperatorsFunction · 0.90
createStreamMethod · 0.45

Tested by

no test coverage detected