CAM::P...NoText(3pm)

πŸ“¦
version 1.60 Β· 2 versions
  • 1.60 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.60 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸŽ€ CAM::P...NoText(3pm) β€” bestie's guide to the PDF graphic state (no-text edition) πŸŽ€

okay so you found the CAM::P...NoText(3pm) page and it's literally just the quiet sibling of a bigger module. stay with me, it's short and slay.


✨ NAME ✨

CAM::PDF::GS::NoText β€” PDF graphic state πŸ’…


πŸ“œ LICENSE πŸ“œ

See CAM::PDF. that's it, that's the whole vibe. 🫢


🌸 SYNOPSIS 🌸

here's the group-chat recipe, verbatim, no cap:

use CAM::PDF;
my $pdf = CAM::PDF->new($filename);
my $contentTree = $pdf->getPageContentTree(4);
my $gs = $contentTree->computeGS(1);

πŸ¦‹ DESCRIPTION πŸ¦‹

so this class is the graphic state at one specific point in the rendering flow of a PDF page. like, where are we, how are we drawing, what's the current vibe. ✨

but β€” and this is the important part β€” it does NOT include the graphics state for text blocks. that functionality lives in the subclass, CAM::PDF::GS. so if you're looking for the text-y stuff, you're in the wrong room, bestie. go next door. πŸšͺ


πŸ’– FUNCTIONS πŸ’–

  • $pkg->new($hashref) β€” creates a brand new instance and sets all the state values to their defaults. it stores a reference to $hashref and sets the property "$hashref-"{fm}> to undef. yes, that's exactly how it's written, i'm not touching it, it's iconic in a cursed way. πŸ’€
  • $self->clone() β€” duplicates the instance. copy-paste but make it classy. πŸ‘‘

🌈 CONVERSION FUNCTIONS 🌈

  • $self->applyMatrix($m1, $m2) β€” applies $m1 to $m2, and saves the result in $m2. math girlies rise. πŸ”₯
  • $self->dot($matrix, $x, $y) β€” computes the dot product of a position against the coordinate matrix. ✨
  • $self->userToDevice($x, $y) β€” converts user coordinates into device coordinates. glow up but for numbers. πŸ’…
  • $self->getCoords($node) β€” computes the device coordinates for the specified node. this implementation handles line-drawing nodes. so like, lines only, don't get weird with it. πŸŽ€
  • $self->nodeType($node) β€” returns the type of the specified node, and it's one of "block", "path", "paint", "text", or β€” the fallback case β€” "op". four real ones and one backup dancer. πŸ’ƒ

⭐ DATA FUNCTIONS ⭐

the whole squad, no descriptions attached, just vibes and arguments:

  • $self->i($flatness)
  • $self->j($linejoin)
  • $self->J($linecap)
  • $self->ri($rendering_intent)
  • $self->Tc($charspace)
  • $self->TL($leading)
  • $self->Tr($rendering_mode)
  • $self->Ts($rise)
  • $self->Tw($wordspace)
  • $self->w($linewidth)
  • $self->g($gray)
  • $self->G($gray)
  • $self->rg($red, $green, $blue)
  • $self->RG($red, $green, $blue)
  • $self->k($cyan, $magenta, $yellow, $black)
  • $self->K($cyan, $magenta, $yellow, $black)
  • $self->gs() β€” (Not implemented...) 🫠 yeah. not implemented. moving on.

and then these ones, some of which actually got notes:

  • $self->cm M1, M2, M3, M4, M5, M6
  • $self->d($arrayref, $scalar)
  • $self->m($x, $y) β€” Move path. πŸšΆβ€β™€οΈ
  • $self->l($x, $y) β€” Line path. πŸ“
  • $self->h()
  • $self->c($x1, $y1, $x2, $y2, $x3, $y3)
  • $self->v($x1, $y1, $x2, $y2)
  • $self->y($x1, $y1, $x2, $y2)
  • $self->re($x, $y, $width, $height) β€” Rectangle path. πŸ”²
heads up: $self->cm is listed with spaces instead of commas around its args in the original, so i'm keeping it exactly that way. not a typo on my end, promise. πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

See CAM::PDF. πŸ’œ


and that's the whole page, bestie!! 🌸 this one came from the User Contributed Perl Documentation, it's perl v5.36.0, dated 2022-12-08, and yeah the footer also says CAM::P...NoText(3pm) because the title is too long and got its little edges cut off. slay, honestly. πŸŽ€πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from