NAME
PDF::Make::Builder::Image - Image embedding for PDF::Make
SYNOPSIS
$builder->add_image(
image => '/path/to/photo.jpg',
w => 300,
align => 'center',
);
DESCRIPTION
Embeds a raster image (JPEG, PNG, etc.) onto the current page, maintaining aspect ratio when only one dimension is specified.
PROPERTIES
- image (Str, required)
-
File path to the image.
- mime (Str)
-
MIME type override. Normally auto-detected from the file.
- align (Str)
-
Horizontal alignment:
'center'to centre the image in the content area. - x (Num)
-
Left edge X coordinate. Defaults to the content area's left edge.
- y (Num)
-
Bottom edge Y coordinate (bottom-left origin). Defaults to the current cursor minus image height.
- w (Num)
-
Display width in points. Defaults to the full content width.
- h (Num)
-
Display height in points. When omitted, calculated from
wto preserve the image's aspect ratio.
METHODS
- add($builder)
-
Embeds and renders the image onto the builder's current page, advancing the cursor. Returns
$self.