PDF::Bu...e::TIFF(3)

πŸ’– PDF::Builder::Resource::XObject::Image::TIFF(3) πŸ’–

okay bestie, sit down, hydrate, because today we're talking about TIFF image support in PDF::Builder. yes, the manual page is literally called PDF::Builder::Resource::XObject::Image::TIFF and yes that is a mouthful, but she's iconic and she knows it. πŸ’…

lowkey important: this class inherits from PDF::Builder::Resource::XObject::Image. so all that parent energy is flowing down into here. 🧬✨

🌸 METHODS 🌸

✨ new ✨

$res = PDF::Builder::Resource::XObject::Image::TIFF->new($pdf, $file, %opts)

bestie this is the constructor, the birth of your TIFF-image object. she returns a TIFF-image object, no cap. πŸ¦‹

here's the tea tho: if the Graphics::TIFF package is installed, the TIFF_GT library gets used instead of the TIFF library. she picks the fancy one automatically, main character behavior honestly. but if you're in your stubborn era, you can force use of the TIFF library with the "nouseGT" flag β€” go peek at the Builder documentation for image_tiff() for the deets. πŸ“–πŸ’–

Options:

  • 'name' => 'string' β€” this is the name you can give your TIFF image object, like naming your pet. 🐾 the default is Ixnnnn.
🚨 reminder bestie: you need to use the Builder.pm method image_tiff in order to display a TIFF file. don't skip that step, it's giving required. 😭

πŸŽ€ usesLib πŸŽ€

$mode = $tif->usesLib()

she tells you what's going on with the libraries. the vibes:

  • returns 1 if Graphics::TIFF is installed and used βœ…
  • returns 0 if not installed ❌
  • returns -1 if installed but not used (aka the nouseGT option was given to "image_tiff") πŸ™ˆ
⚠️ Caution: this method can only be used after the image object has been created. it literally cannot tell you whether Graphics::TIFF is available in advance of actually using it β€” which is a problem if you wanted to use some functionality that only exists in TIFF_GT. so if you need to know ahead of time, go look at the <PDF::Builder> LA_GT() call instead. periodt. πŸ‘‘

πŸ’œ tiffTag πŸ’œ

$value = $tif->tiffTag($tag)

returns the value of the internal tiff-tag. she's a lil peek behind the curtain, iykyk. πŸ”βœ¨

Useful Tags:

imageDescription, imageId (strings)
xRes, yRes (dpi; pixel/cm if resUnit==3)
resUnit

so imageDescription and imageId are strings 🧡, xRes and yRes are in dpi β€” but heads up, they're in pixel/cm if resUnit==3 πŸ‘€ β€” and then there's resUnit doing her own thing.


okay that's the whole page bestie, you ate that. go build some TIFFs, slay, and remember: the TIFF library vs the TIFF_GT library is a whole personality trait. 🫢

this lil gem is from perl v5.42.0, dated 2026-01-17, and it's part of the User Contributed Perl Documentation for PDF::Builder::Resource::XObject::Image::TIFF. bye pookie!! πŸ’–πŸŒˆπŸŽ€

πŸ“¦ where this page comes from