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.
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.
- 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.
- 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
oryarn install
to install dependencies
- 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 haveteacher_room
set to the classroom teacher's last name. Staff members who belong on the staff page should haveteacher_room
set to staff. - run
php artisan yearbook:generate
- this will generate PDFs for each classroom and save them in/storage/generated-yearbook
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
.
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.
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.
Alex P. Gates
I am not affiliated with Scholastic or Scholastic Photography.
- Laravel - Laravel PHP Framework
- Browsershot - PDF generation from using a headless Chrome browser
- Bootstrap 4 - For page layout
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details
Please get in touch! I'd be very happy to help.
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!