modern-pdf-lib / drawImageXObject
Function: drawImageXObject()
drawImageXObject(
name,x,y,width,height):string
Defined in: src/core/operators/image.ts:59
Produce the full operator sequence to draw an image XObject at the given position and dimensions.
This emits:
q— save graphics statecm— transformation matrix that maps the image's unit square to the rectangle(x, y, width, height)Do— paint the XObjectQ— restore graphics state
Parameters
name
string
Resource name of the XObject (e.g. Im1).
x
number
Lower-left x coordinate of the image on the page.
y
number
Lower-left y coordinate of the image on the page.
width
number
Rendered width of the image.
height
number
Rendered height of the image.
Returns
string