You already have an automated report pipeline that emits PDF invoices, contracts, or inspections. One day product asks: "Can we also drop in the photographer's JPG from the site visit, or the customer's signature image?" The conversion is trivial. The blast radius is not. A naive "merge the JPG into the PDF" solution leaks through to receipts, screen readers, and print drivers in ways that only show up weeks later.

This article is for the engineer who has to plug that requirement in today, not the document specialist who gets a week to plan it.

The Real Problem Is Not "JPG to PDF"

Calling this a "JPG to PDF conversion" is the first framing mistake. Almost no real product asks the user to upload JPGs and download a PDF. They ask for a PDF with JPG content embedded into an existing document, at a specific point in the layout, sized to a specific box, addressed at a specific audience. The conversion is a side-effect, not the deliverable.

In a production pipeline you generally face one of three flavors: