XX
Automated Document Layout Engine DeveloperFreelanceJobsCanada

This job offer is no longer available

XX

Automated Document Layout Engine Developer

FreelanceJobs
  • CA
    Canada
  • CA
    Canada

About

We are building an automated document generation service that produces professionally typeset, multi-page PDF documents at high volume (100K+ per day). Each document is personalized — dynamically assembled from a pool of pre-written content blocks based on a JSON manifest — and must meet strict layout and typographic quality standards.
The core technical challenge is a constraint-based layout solver: given a set of variable-length content items and a library of fixed page templates, the system must select appropriate templates, allocate content to layout regions, and fit text precisely — trimming, reflowing, or adjusting content variants as needed to eliminate overflow and whitespace. Think bin-packing meets typesetting.
What's Already Built
- A FastAPI backend that receives JSON content manifests and orchestrates the pipeline
- WeasyPrint for HTML/CSS → PDF rendering
- A set of Jinja2 page templates covering several layout variants — these are a starting point but may need reworking based on the solver's requirements
- A detailed design specification covering typography, grid structure, content rules, and page composition guidelines
- A comprehensive layout rule set governing content placement, sizing constraints, topic mixing, minimum display requirements, and overflow handling. These rules are non-negotiable — the solver must respect them. That said, the right candidate will recognize most of these rules as standard typesetting and layout best practices, and may suggest refinements based on their own experience
We have iterated through several architectural approaches for the layout solver and have not yet landed on one that reliably produces correct output. The right candidate will have a strong voice in shaping the final architecture — we're looking for someone who can own the layout engine design, not just implement a spec.
What We Need Help With
- The layout solver — the algorithmic core that makes all placement decisions. We've iterated on several approaches and need someone who can design and build the right one. Key problems to solve:
- Layout engine architecture — designing the overall approach for how content gets measured, allocated, and rendered into fixed page templates. We're open to the right solution, whether that's a multi-pass rendering loop, a pre-calculation model, or something else entirely
- Template selection logic — choosing the best page template based on available content characteristics (length, presence of images, topic mix)
- Content allocation & bin-packing — assigning content items to template regions while respecting size constraints, topic diversity rules, and priority ordering
- Fit optimization — ensuring content fits precisely within layout regions, with strategies for handling overflow and underflow (toggling optional elements, switching content variants, reallocating)
- Continuation handling — flowing long content across pages or connected regions with proper typographic breaks
Deterministic, rule-based decisions — no AI/ML in the layout pipeline; all decisions must be algorithmic and reproducible
Ideal Candidate
- Strong Python — this is a pure Python project (FastAPI, Jinja2, WeasyPrint)
- Algorithm design experience — constraint satisfaction, bin-packing, optimization, or similar combinatorial problems
- Document generation / typesetting background — experience with automated report generation, publishing pipelines, print production, or PDF toolchains is highly valued
- WeasyPrint or CSS Paged Media familiarity — understanding WeasyPrint's rendering model, its CSS support gaps, and how to work within its limitations
- Methodical debugger — the hardest part of this project is diagnosing why content overflows or underflows specific layout regions; you need to be comfortable measuring, logging, and iterating
- Typesetting intuition — we have a detailed rule set, but we're looking for someone who already understands principles like minimum content thresholds, content prioritization by length, orphan/widow control, and continuation logic. If our rules feel familiar rather than foreign, you're probably the right fit
Bonus: Experience with LaTeX, Typst, InDesign Server, or other professional typesetting systems
What This Is NOT
- This is not a web design project — we are generating PDFs, not websites
- This is not an AI/ML project — the solver must be deterministic and rule-based
- The content pipeline and API infrastructure exist, but the layout engine itself is largely unsolved — you will have significant architectural ownership
To Apply
Please include:
A brief description of any prior work on automated document generation, layout algorithms, or typesetting systems
How you would approach the bin-packing / content-fitting problem described above (even a high-level sketch is helpful)
Your experience with WeasyPrint, CSS Paged Media, or alternative PDF rendering tools
Availability and hourly rate
We value clear thinking over keyword-stuffing. If you've solved similar layout constraint problems in a different domain (game UI, dashboard generation, print catalogs), we'd love to hear about it.
Contract duration of 1 to 3 months. with 30 hours per week.
Mandatory skills: Python, Algorithmic design, pdf generation, WeasyPrint, FastAPI, CSS, Jinja2
  • Canada

Languages

  • English
Notice for Users

This job was posted by one of our partners. You can view the original job source here.