← Blog
Page two of two six-page board packets. The returned copy opens on the finance report. The corrected copy opens on the prior meeting minutes.
Published on

Merge PDFs with Python to build a board packet in agenda order

Page two of the December 4 board packet should open on the prior meeting minutes. In one proof, it opens on the finance report. Both documents are there, the motion is on page six, and the PDF opens normally. A page count alone would let that packet through.

To merge PDFs with Python in agenda order, give pypdf.PdfWriter.append() the approved files in that order and write a new PDF. Then reopen the packet and check the first page of each attachment against the agenda. Here’s how that worked for the fictional Linden Reading Room board.

Set the order before merging the files

Download the four contributor PDFs, approved order sheet, merge script and three example packets. Open approved-order.csv first. Its four rows identify the approved filename, revision, page count and expected position in the combined PDF.

  • Page 1. Meeting agenda, revision R3. The fourth item calls for a decision on Saturday opening.
  • Pages 2–3. Prior meeting minutes, R2. The first page records the November discussion. The second carries forward the request for a staffing estimate.
  • Pages 4–5. Finance report, R4. The estimate comes first, followed by the basis for the $2,400 ceiling.
  • Page 6. Motion for decision, R1. Members need the wording they will vote on.

Alphabetical sorting would put decision-motion-r1.pdf first. Use the row order in the approved sheet. If a contributor replaces a file, confirm the new revision and update any ranges affected by its length before rebuilding.

Build a fresh review copy with pypdf

Unzip the sample and open a terminal in the folder that contains approved-order.csv. With a Python environment active, run the following commands. The sample was checked on Windows with Python 3.12.14 and pypdf 6.21.4.

python -m pip install pypdf==6.21.4
python assemble_packet.py

The script reads the sheet from top to bottom. For each row, it opens the named file from contributors, checks its page count, and appends it. These are the two lines that add each attachment to the packet:

reader = PdfReader(source)
writer.append(reader)

The complete script in the download includes the count check between those lines. A missing listed file or a count mismatch stops the run before it opens the output. It writes board-packet-review.pdf in the current folder and refuses to overwrite an existing copy. Use a fresh working folder for another review. If the sheet itself leaves out the motion, the script has no way to know the board needs it. Keep the approved agenda open for the next check. pypdf’s merging examples.

Make the circulation decision on the combined PDF

Open the three files in examples beside the order sheet. Use the page position in the PDF viewer. The footer “Attachment page 1 of 2” appears in both the minutes and the finance report, so it cannot identify packet page two on its own.

Hold the five-page packet. In missing-motion.pdf, the final page is “Basis of estimate.” Members can see what eight Saturday sessions would cost, but the motion they are being asked to approve is missing. Restore the approved R1 motion and rebuild before circulation.

Return the six-page packet with swapped sections. In swapped-sections.pdf, page two says “Finance report,” R4. The minutes start on page four. Both attachments are two pages long, so the total still matches. Move the minutes ahead of finance in the input order and rebuild. Renumbering the sheet to match the mistake would send members to the wrong report.

Release the corrected sample. In corrected-packet.pdf, page two opens on “Prior meeting minutes,” R2, and page four opens on “Finance report,” R4. Page six asks the board to approve eight Saturday sessions with total staffing costs capped at $2,400. That wording matches the finance estimate and completes agenda item four. Record the exact filename and ranges from the copy you checked before circulating it.

If someone needs just the finance item, split the approved packet by page range and check the first and last pages of the file you’ll send.

Allow time for the editor’s final read

We rendered and inspected all 17 pages across the three sample packets. We also rebuilt the corrected six-page packet from the ZIP and checked its page text against the supplied corrected example. These checks cover ordinary local PDFs. We did not test signed files, interactive forms or cloud deployment.

A workstation handled this meeting. If several committees share a cutoff, record the number of files and pages and the time spent merging and rendering them separately from the time spent waiting for approvals. If machine time regularly cuts into the editor’s final read, use those measurements to compare CPU VM options for the recurring job.

Your next workload belongs on Hivenet.

Pick one AI, compute, or storage workload and see the difference for yourself. Spin it up in minutes, or let our team map your fastest path to production.