PDF::Builder
v3.028 Released, 31 December 2025
Please also see the
CPAN listing, the
GitHub entry, and the latest changes list.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
— attributed to Richard Cook
PDF::Builder::Resource::XObject::Image - Base class for external raster image objects
Inherits from PDF::Builder::Resource::XObject
$image = PDF::Builder::Resource::XObject::Image->new($pdf, $name)
Returns an image resource object.
$width = $image->width()
Get the width (in points) of the image object.
Note that this function also has the ability to set the width, by giving the new width (in points), but it appears that it never worked correctly. The set capability has been deprecated, and may be removed soon, unless it is found to be needed for an <img> tag in
column(). If you are using thewidth()method in some manner to set the image width, please let us know, so we can plan to keep it enabled!
$height = $image->height()
Get the height (in points) of the image object.
Note that this function also has the ability to set the height, by giving the new height (in points), but it appears that it never worked correctly. The set capability has been deprecated, and may be removed soon, unless it is found to be needed for an <img> tag in
column(). If you are using theheight()method in some manner to set the image height, please let us know, so we can plan to keep it enabled!
$image->smask($xobject)
Set the soft-mask image object.
$image->mask(@color_range)
$image->mask($xobject)
Set the mask to an image mask XObject or an array containing a range of colors to be applied as a color key mask.
$image->colorspace($name)
$image->colorspace($array)
Set the color space used by the image. Depending on the color space, this will either be just the name of the color space, or it will be an array containing the color space and any required parameters.
If passing an array, parameters must already be encoded as PDF objects. The array itself may also be a PDF object. If not, one will be created.
$image->bits_per_component($integer)
Set the number of bits used to represent each color component.
Master Index
PDF::Builder -- Facilitates the creation and modification of PDF files
PDF::Builder::Resource -- Base class for PDF resources
PDF::Builder::Resource::XObject -- Base class for external objects
PDF::Builder::Resource::XObject::Form -- Base class for external form objects
PDF::Builder::Resource::XObject::Image::GD -- Support routines for Graphics Development image library
PDF::Builder::Resource::XObject::Image::GIF -- Support routines for GIF image library
PDF::Builder::Resource::XObject::Image::JPEG -- Support routines for JPEG image library
PDF::Builder::Resource::XObject::Image::PNG -- Support routines for PNG image library (using pure Perl code)
PDF::Builder::Resource::XObject::Image::PNG_IPL -- Support routines for PNG image library (using Image::PNG::Libpng)
PDF::Builder::Resource::XObject::Image::PNM -- Support routines for PNM (Portable aNy Map) image library
PDF::Builder::Resource::XObject::Image::SVG -- Support routines for SVG (Scalable Vector Graphics) image library
PDF::Builder::Resource::XObject::Image::TIFF -- TIFF image support
PDF::Builder::Resource::XObject::Image::TIFF_GT -- TIFF image support (Graphics::TIFF enabled)
All content © copyright 2005 – 2026
by Catskill Technology Services, LLC.
All rights reserved.
Note that Third Party software (whether Open Source or proprietary) on this
site remains under the copyright and license of its owners.
Catskill Technology Services, LLC does not claim copyright over such software.
This page is https://www.catskilltech.com/Documentation/PDF/Builder/Resource/XObject/Image.html
Search Quotations database.
Last updated Thu, 01 Jan 2026 at 7:59 PM