CAM::P...NoText(3pm)
π 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$hashrefand sets the property"$hashref-"{fm}>toundef. 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$m1to$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
- debian bookworm: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms