PHPackages                             a-schild/pdfcalendarbuilder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. a-schild/pdfcalendarbuilder

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

a-schild/pdfcalendarbuilder
===========================

PDF month calendar generator

1.0.16(2mo ago)43.9k—0%1Apache-2.0PHPPHP ^8.2

Since Mar 27Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/a-schild/pdfcalendarbuilder)[ Packagist](https://packagist.org/packages/a-schild/pdfcalendarbuilder)[ Docs](https://github.com/a-schild/pdfcalendarbuilder)[ RSS](/packages/a-schild-pdfcalendarbuilder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (0)

PDFCalendarBuilder
==================

[](#pdfcalendarbuilder)

Generate pdf month calendars with autoscaling/sizing

With the addMonth() introduced in 1.0.8 you can generate a PDF containing multiple months. Each month will be on it's own page then.

Unique features
---------------

[](#unique-features)

- The class can try to put everything on one page
- In an normal calendar, all rows have the same height
- This library can shrink/expand rows, so everything fits on one page. See setResizeRowHeightsIfNeeded(true/false);
- If this is not enough, it can reduce the font size until everything fits on one page. See setShrinkFontSizeIfNeeded(true/false);

Additional options
------------------

[](#additional-options)

- **Full time display**: Show times as `9:00` instead of `9h` with `setShowFullTime(true)`
- **Custom grid height**: Override the auto-calculated grid height with `overrideGridHeight($height)`, useful when embedding the calendar in a larger PDF layout
- **End time display**: Show entry end times with `setPrintEndTime(true)`
- **Categories**: Define categories with `addCategory($id, $name, $textColor, $bgColor)` and assign entries via `addEntryCategory()`. Call `printCategories()` before `buildCalendar()` to render a color legend at the bottom of the page.
- **Week start**: Set Monday as the first day of the week with `setWeekStarts(1)` (default is 0 for Sunday)
- **Font sizes**: Customize with `setTitleFontSize()`, `setHeaderFontSize()`, `setNumberFontSize()`, `setEventFontSize()`, `setCategoryFontSize()`

Usage:
------

[](#usage)

In your composer.json add the dependency:

```
    "require": {
        "php": "^8.2",
        "a-schild/pdfcalendarbuilder": ">=1.0.16",
    }

```

### Creating the class and generate calendar

[](#creating-the-class-and-generate-calendar)

```
$cal = new aschild\PDFCalendarBuilder\CalendarBuilder(1, 2019, "Calendar title", true, 'mm', 'A4');
$cal->startPDF();
$cal->addEntry($startDate, $endDate, "Entry 1", "#000000", "#fffff");
$cal->buildCalendar();
$cal->Output("calendar.pdf", "I");

```

### Creating the class and generate calendar for 3 months (Required version 1.0.7 or higher)

[](#creating-the-class-and-generate-calendar-for-3-months-required-version-107-or-higher)

```
$cal = new aschild\PDFCalendarBuilder\CalendarBuilder(1, 2019, "Calendar title Jan", true, 'mm', 'A4');
$cal->startPDF();
$cal->addEntry($startDate1, $endDate1, "Entry 1", "#000000", "#ffffff");
$cal->buildCalendar();
$cal->addMonth(2, 2019, "Title for Feb");
$cal->addEntry($startDate2, $endDate2, "Entry 1", "#000000", "#ffffff");
$cal->buildCalendar();
$cal->addMonth(3, 2019, "Title for March");
$cal->addEntry($startDate3, $endDate3, "Entry 1", "#000000", "#ffffff");
$cal->buildCalendar();
$cal->Output("calendar.pdf", "I");

```

Examples
--------

[](#examples)

- Empty calendar, no entries, just a month grid [![Empty calendar ](doc/img/calendar-empty.png)](doc/img/calendar-empty.png)
- Overflowing boxes in normal libraries [![Box overflow in normal calendars](doc/img/calendar-overflow.png)](doc/img/calendar-overflow.png)
- Resize row heights to adapt space usage [![Resize rows height](doc/img/calendar-resize-row2.png)](doc/img/calendar-resize-row2.png)
- Resize row heights and shrink font size if needed [![Resize rows and shrink font](doc/img/calendar-resize-rows-shrink-fontsize.png)](doc/img/calendar-resize-rows-shrink-fontsize.png)
- Day spanning events [![Events which span days](doc/img/calendar-day-spanning.png)](doc/img/calendar-day-spanning.png)

(C) 2019 - 2026 A.Schild

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance83

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~157 days

Recently: every ~628 days

Total

17

Last Release

89d ago

PHP version history (3 changes)v1.0.1PHP ^7.3

1.0.11PHP ^8.1

1.0.13PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/be34b954f5f13119b88523b231b60a18b19740c8907e82f315a49adefd2ed5e8?d=identicon)[a-schild](/maintainers/a-schild)

---

Top Contributors

[![a-schild](https://avatars.githubusercontent.com/u/1441009?v=4)](https://github.com/a-schild "a-schild (48 commits)")

---

Tags

calendarchurchtoolslibrarymonthpdfphpphp82pdfcalendar

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/a-schild-pdfcalendarbuilder/health.svg)

```
[![Health](https://phpackages.com/badges/a-schild-pdfcalendarbuilder/health.svg)](https://phpackages.com/packages/a-schild-pdfcalendarbuilder)
```

###  Alternatives

[spipu/html2pdf

Html2Pdf is a HTML to PDF converter written in PHP - It uses TCPDF - OFFICIAL PACKAGE

1.8k10.6M45](/packages/spipu-html2pdf)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[iio/libmergepdf

Library for merging multiple PDFs

40813.6M13](/packages/iio-libmergepdf)[imal-h/pdf-box

The most advanced, driver-based PDF manipulation library for PHP v3.0. Supports Ghostscript, Chrome Headless (HTML to PDF), OpenSSL/FPDI (Signing), and PDFtk (Forms).

60403.9k](/packages/imal-h-pdf-box)[propa/tcpdi

TCPDI is a PHP class for importing PDF to use with TCPDF

231.1M1](/packages/propa-tcpdi)[bithost-gmbh/pdfviewhelpers

This is a TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.

45242.7k2](/packages/bithost-gmbh-pdfviewhelpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
