[Raku PDF Project] / [PDF-Content Module] / PDF::Content :: Image
loading and manipulation of PDF images
use PDF::Content::Image;
my PDF::Content::Image $image .= open: "t/images/lightbulb.gif";
say "image has size {$image.width} X {$image.height}";
say $image.data-uri;
# data:image/gif;base64,R0lGODlhEwATAMQA...
This class currently supports image formats: PNG, GIF and JPEG.
multi method load(
Str $data-uri where { ... }
) returns PDF::Content::Image
load an image from a data URI string
multi method load(
IO::Path(Any) $io-path
) returns PDF::Content::Image
load an image from a path
multi method load(
IO::Handle $source
) returns PDF::Content::Image
load an image from an IO handle
method data-uri() returns PDF::Content::Image::DataURI
Get or set the data URI from an image