Commits

Auto Magazine: The MVP works end to end with the actual issue

Real-world material exposes the errors, print export now delivers CMYK and preflight, and the core phase closes with an all-green report.

The project has reached the goal it set from day one: an all-green print report with the user's actual issue inside. The wayfinder map's acceptance criterion — an issue laid out and exported from start to finish, passing preflight and with no intermediate manual editing — was met, closing the core phase with thirty-seven green tests.

Real-world material reveals what tests miss

It was a busy morning. Typesetting in production was not working, and the container logs showed an AssertionError inside WeasyPrint: the drop cap—an initial letter with a float on ::first-letter—works when the article begins on a fresh page, but it breaks when the continuous flow splits the first paragraph across two pages. We removed the float, and the letter now remains large and in the brand color without floating; a truly floating drop cap has been recorded as a design goal, but it is not reliable in WeasyPrint today.

Next, the photos from real articles were not appearing: they had been anchored as floating Word images (wp:anchor), which the python-docx library does not expose by default. Extraction now reads them directly from the document XML, in order of appearance, alongside images embedded in the text. One subtle issue remained: the featured photo coming from the subfolder was disappearing from the PDF because two lists were sharing the responsibility. The gallery excluded it because it was the featured image, while the featured-image slot only knew how to render images embedded in the document. There is now a single solution: the featured image is rendered no matter where it comes from (identified by its digital fingerprint, or SHA1), and everything else goes into the gallery, guaranteeing that no image is left without a place.

Exporting for print, with honesty

The sixth phase brought the "Export to print" button: real CMYK conversion (the color model used by printing machines with cyan, magenta, yellow, and black) using Ghostscript, metadata with pikepdf, and automatic preflight. Preflight is a quality-control check that verifies that the document meets all the technical requirements before printing. The report appears green or red in the panel and checks that the page count is a multiple of 4, that the TrimBox (final trim size) is correct on every page, that the minimum bleed is 3 millimeters, and that the images have an effective resolution.

We made two decisions in favor of honesty: without Ghostscript in the environment, the process continues, but the CMYK conversion remains red—the PDF is never considered valid in a partial state—and checks with no binary available report "not available" instead of faking a measurement. Another good catch emerged: the report was flagging CMYK color as red without any further detail, and the cause was a -d where there should have been an -s: ColorConversionStrategy is a string parameter, and it was being passed as a flag. With the option passed correctly, the final PDF contains genuine DeviceCMYK images, verified with pikepdf.

The MVP, end to end

With all of this, the core phase is fully closed: hotfolder (a monitored folder that automatically processes files whenever material is placed in it), layered extraction with AI, typesetting with flat templates and a theme, pagination with continuous flow and a page count that is a multiple of 4, and print export with CMYK and preflight. None of these bugs would have surfaced with synthetic material: testing with the user's actual issue is what uncovered all of them. This opens the review-and-polish phase, with the friction points already noted on the map and any improvements the user wants to request.