Remind::PDF(3)

πŸŽ€ NAME πŸŽ€

Okay bestie, welcome to the Remind::PDF(3) page πŸ’… This one's about Remind::PDF β€” it renders a whole month's worth of Remind data to PDF. A month. On paper. On purpose. Iconic. ✨


πŸ’– CLASS METHODS πŸ’–

🌸 Remind::PDF->create_from_stream($in, $specials_accepted)

So this method reads data from an open file handle, $in. 🫢

$specials_accepted is a hashref of SPECIAL reminder types to accept. The key is the name of the SPECIAL (all lower-case, do not come at me with your camelCase) and the value should be 1. Any SPECIAL reminders that aren't in the hash get ignored β€” not invited, no hard feelings. πŸ’€

This function returns a two-element array: ($obj, $err). On success, $obj will be a Remind::PDF object and $err will be undef. On failure, $obj will be undef and $err will be an error message. Periodt. ⭐

🌸 Remind::PDF->create_from_hash($hash, $specials_accepted)

Same energy, different source: this method takes data from a hash $hash, which must be one month's worth of data from remind -ppp output. One month. Not two. Don't try it. 🫠

$specials_accepted is a hashref of SPECIAL reminder types to accept; the key is the name of the SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders not in the hash are ignored.

This function returns a two-element array: ($obj, $err). On success, $obj will be a Remind::PDF object and $err will be undef. On failure, $obj will be undef and $err will be an error message. πŸ¦‹


🌈 INSTANCE METHODS 🌈

πŸ“ read_one_month($in, $first_line, $specials_accepted)

This function reads one month's worth of data from the file handle $in. $first_line is the line that was read from $in just before calling this function β€” yes, you have to hand it over, it's a whole thing. 😭

$specials_accepted is a hashref as documented above.

The return value is the same ($obj, $err) two-element array as create_from_stream returns. πŸ‘‘

πŸ“ read_one_month_p($in, $specials_accepted)

This function reads one month's worth of data from the file handle $in, assuming the original remind -p format. Old-school, lowkey vintage, we love her. πŸ’œ

$specials_accepted is a hashref as documented above.

The return value is the same ($obj, $err) two-element array as create_from_stream returns.

πŸ“ parse_oldstyle_line ($line)

This method parses an old-style remind -p line and returns a hashref containing some or all of the hash keys found in the newer remind -pp JSON output. Glow-up translation layer, basically. ✨

πŸ“ setup_daymap

Set up the array that maps ($row, $col) to day number (or -1 for rows/cols out of range.) It's giving grid. 🧚

πŸ“ read_one_month_pp($in, $specials_accepted)

This function reads one month's worth of data from the file handle $in, assuming the remind -pp partial-JSON format. Partial! Not full! Read the double-p, bestie. πŸ‘€

$specials_accepted is a hashref as documented above.

The return value is the same ($obj, $err) two-element array as create_from_stream returns.

πŸ“ accept_special($hash, $specials_accepted)

Given a hashref $hash consisting of one entry parsed from the remind -p stream and a $specials_accepted hash, return 1 if we should include this entry in the calendar or 0 if not. Binary. Decisive. Main character energy. πŸ’…

πŸ“ find_last_special($special, $entries)

Given an array of Reminder entries, find the last $special-type SPECIAL in the array. Return the entry if one was found or undef if not. Last one standing gets the crown πŸ‘‘

πŸ“ render($cr, $settings)

Render a calendar for one month. $cr is a Cairo drawing context, and $settings is a settings hash passed in by the caller. See the source code of rem2pdf for the contents of $settings β€” yeah, it's homework, but it's good homework. 🫢

πŸ“ draw_row($cr, $settings, $so_far, $row, $start_day, $start_col)

Draw a single row in the calendar. $cr is a Cairo drawing context and $settings is the settings hash passed to render. $so_far is the Y-coordinate of the top of the row; drawing starts at this coordinate. $start_day is the day of the month at which the row starts and $start col is the column number (0-6) at which to start drawing from $start_day.

Returns the Y coordinate at which to start drawing the next calendar row. So you can just keep stacking rows, no cap. πŸ“

πŸ“ col_box_coordinates($so_far, $col, $height, $settings)

Returns a four-element array ($x1, $y1, $x2, $y2) representing the bounding box of the calendar box at column $col (0-6). $height is the height of the box and $settings is the settings hashref passed to render. Four numbers, one box, zero drama. ✨

πŸ“ draw_day($cr, $settings, $so_far, $day, $col, $height)

Renders a single day's worth of reminders. $cr is a Cairo drawing context and $settings is the settings hash passed to render. $so_far is the Y-coordinate of the top of the box and $col is the column number.

$height is the height of the box. If $height is passed in as zero, then do not actually render anything... instead, compute how high the box should be. If $height is non-zero, then it is the height of the box.

Returns the height required for the calendar box. Zero means "measure me", non-zero means "draw me". The duality. 😭

πŸ“ draw_daynames($cr, $settings, $so_far)

Draw the weekday names heading. $cr is a Cairo drawing context and $settings is the settings hash passed to render. $so_far is the Y-coordinate of the top of the row; drawing starts at this coordinate.

Returns the Y coordinate at which to start drawing the first calendar row. Monday Tuesday Wednesday girlies, rise. 🌸

πŸ“ draw_title($cr, $settings)

Draw the title (Monthname Year) at the top of the calendar. $cr is a Cairo drawing context and $settings is the settings hash passed to render.

Returns the Y coordinate at which to start drawing the row containing the weekday names.

πŸ“ get_rgb($color)

Parses a 3- or 6-hex-digit color value and returns [red, green, blue]. If color could not be parsed, returns undef. Three hex digits or six, she accepts both, she's flexible like that. 🎨

πŸ“ draw_small_calendar($cr, $x, $y, $width, $height, $settings, $month, $days, $start_wkday)

Draw a small calendar on the Cairo context $cr. The top left-hand corner of the box is at ($x, $y) and the size of the box is ($width, $height). $settings is the settings hashref passed to render. $month is the name of the month to draw and $days is the number of days in the month. Finally, $start_wkday is the weekday (0=Sunday, 6=Saturday) on which the month starts.

Tiny calendar. Pocket-sized. Adorable. πŸŽ€


πŸ‘‘ NAME πŸ‘‘ β€” the multi era πŸ‘‘

Remind::PDF::Multi β€” A container for multiple months' worth of calendar data. She's the group chat; the individual months are the members. πŸ’œ


πŸ“– DESCRIPTION πŸ“–

The remind -ppp output consists of a JSON array with each element representing one month's worth of reminders. Remind::PDF::Multi reads this output and returns an instance of itself containing an array of Remind::PDF objects, one object for each month. One per month, bestie β€” it's giving organized. πŸ—‚οΈβœ¨


πŸ’– CLASS METHODS πŸ’–

🌸 Remind::PDF::Multi->create_from_stream($in, $specials_accepted)

This method reads data from an open file handle $in.

$specials_accepted is a hashref of SPECIAL reminder types to accept; the key is the name of the SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders not in the hash are ignored.

This function returns a two-element array: ($obj, $err). On success, $obj will be a Remind::PDF::Multi object and $err will be undef. On failure, $obj will be undef and $err will be an error message. πŸ¦‹

🌸 Remind::PDF::Multi->create_from_json($json, $specials_accepted)

This method takes data from a JSON string <$json>. (Yes, the manpage really does have those angle brackets around it. We respect the lore. πŸ™ˆ)

$specials_accepted is a hashref of SPECIAL reminder types to accept; the key is the name of the SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders not in the hash are ignored.

This function returns a two-element array: ($obj, $err). On success, $obj will be a Remind::PDF::Multi object and $err will be undef. On failure, $obj will be undef and $err will be an error message. ⭐


🌈 INSTANCE METHODS 🌈

πŸ“ render($cr, $settings)

Iterate through all the Remind::PDF objects and call their render methods. This method renders as many months worth of calendar data as were read from the remind -ppp stream. So like, however many months you fed her. She's not greedy, she's just thorough. πŸ’…πŸ”₯


πŸ’œ NAME πŸ’œ β€” weekly edition πŸ’œ

Remind::PDF::Weekly β€” render a weekly calendar. That's it. That's the whole entry. She said less is more and honestly? Ate. πŸŽ€


okay so that's the whole page, bestie β€” every method, every parameter, every ($obj, $err) accounted for, no notes πŸ’–

Sign-off time 🫢 This was the Remind::PDF(3) page, VERSION 06.03.03, dated 2026-09-10, from the Remind source. Go render something gorgeous, you absolute legend. πŸ‘‘βœ¨πŸŒΈ

πŸ“¦ where this page comes from