Skip to content

Generate a simple PDF yearbook for your school using a photo CD provided by Scholastic

License

Notifications You must be signed in to change notification settings

alexpgates/yearbook-generator

Repository files navigation

Yearbook Generator

Parse a photo CD provided by Scholastic and generate a simple PDF yearbook for your school.

Important: You must use a photo CD provided by Scholastic.

Why?

Instead of expensive yearbooks that only some students can afford, our PTA produces low-cost yearbooks and provides one for free to every student in our school.

In previous years we generated these yearbooks using an automated InDesign work flow, which was a time consuming process. This projects helps simplify the process of creating yearbooks, and it's packaged togather as a re-usable tool that could also benefit other schools.

Getting Started

Prerequisites

  • You'll need a local development environment with PHP 7.1. I recommend Laravel Valet
  • The app is built using the Laravel PHP framework which currently requires PHP 7.1. PDF generation is handled using Spatie's excellent Browsershot package, which requires node 7.6.0 or higher and the Puppeteer Node library.
  • Assets are compiled with either NPM or Yarn.

Installing

  • Clone the repository to your local environment
  • Run composer install
  • Update your .env file appropriately to reference your database settings
  • run php artisan migrate to migrate your datbase tables
  • run npm install or yarn install to install dependencies

Generating your yearbook

  • Copy the contents of your scholastic CD to the storage/app/public/yearbook directory
  • run php artisan yearbook:parse - this will build the database with the Scholastic data
  • in the staff_members directory, fill in appropriate prefix (Mrs. / Ms. / Mr. etc.) and title for each staff member.
  • note teacher_room is used to determine which pages staff belong on. Any staff member (including the teacher) should have teacher_room set to the classroom teacher's last name. Staff members who belong on the staff page should have teacher_room set to staff.
  • run php artisan yearbook:generate - this will generate PDFs for each classroom and save them in /storage/generated-yearbook

Customizing your design

PDFs are generated by creating a PDF from a webpage using a headless browser. The layout file for classroom pages is located at resources/views/classroom.show.blade.php.

By default, this app is configured to use Bootstrap 4. You're free to use whichever framework you want, but you'll need to make the appropriate changes in Laravel and rebuilt your assets using yarn run production.

Next steps

This app only creates individual PDFs for each page. You'll need to take the generated PDFs and combine them with any other yearbook pages + your cover.

TODO

The number of columns on each page is hard-coded in the layout file, and I'm not super jazzed with how that all works. It'd be nice to make this easier to customize and less messy code-wise.

Made by

Alex P. Gates

[email protected]

@alexpgates

I am not affiliated with Scholastic or Scholastic Photography.

Built With

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details

I need help!

Please get in touch! I'd be very happy to help.

[email protected]

@alexpgates

I admit that this looks like a bit of an undertaking if you don't have much experience with web development but I'd love to help!

About

Generate a simple PDF yearbook for your school using a photo CD provided by Scholastic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published