Marks on the page / Full bleed image page
A full page image that reaches the paper edge on all four sides
An image occupying an entire page with no margin, used as a divider, a cover or a plate in a document that will be trimmed.
Why this block is harder than it looks
The page has margins and the image must not respect them, which means a named page with zero margin rather than a negative margin on the image. Then the image has to fill a rectangle whose aspect ratio it does not share, which forces a choice between cropping and letterboxing, and unlike an evidence photograph a decorative full-bleed image can be cropped. The last problem is print: an image that stops at the trim line shows a white sliver on any sheet that shifted, so on a trimmed document it has to extend past it.
The decisions that make it work
Reasons rather than a description of the code. Each of these is a choice that has a wrong answer, and the wrong answer is usually the default.
- Use a named page with margin: 0 for the image page. A negative margin on the image fights the page box and behaves differently across renderers.
- Empty the margin boxes on that page, or the folio prints on top of the image.
- Use object-fit: cover so the image fills the page, and accept the crop. Choose the focal point with object-position rather than letting it default to the centre.
- On a trimmed document, size the page to the bleed size and let the image run to the sheet edge, not to the trim line.
- Force a break before and after, so the image page is exactly one leaf.
- Check the file size. A full-page photograph at print resolution is the single largest thing in most documents, and one per section adds up quickly.
The fragment
Markup and the CSS it needs, and nothing else. It expects a document that already has a page rule and a base stylesheet, so paste it into one rather than opening it on its own.
<section class="plate">
<img src="elevation.jpg" alt="North elevation of the building"
width="3000" height="4000">
</section>
<style>
@page plate {
size: A4;
margin: 0; /* the image owns the whole sheet */
@bottom-right { content: ""; }
@top-center { content: ""; }
}
.plate {
page: plate;
break-before: page;
break-after: page;
height: 100%;
overflow: hidden;
}
.plate img {
display: block;
width: 100%;
height: 100%;
object-fit: cover; /* fill the page, crop the excess */
object-position: 50% 35%; /* a chosen focal point, not the default */
}
</style>What breaks when it is built the obvious way
Pulling the image out to the edge with negative margins on a normal page. Renderers differ on whether content outside the page box is clipped or shifts the box, so the same markup produces a full-bleed image in one and a shifted, partly clipped one in another.
How to prove it survived pagination
Render and confirm the image touches all four edges with no white line, and that no folio or header is printed over it. On a trimmed document, measure the page: it should be the bleed size, and the image should reach its edge rather than the trim line.
Where it sits in a finished document
This page is one block. The document it belongs to has a page rule, a base stylesheet, a header and everything else around it, and repeating all of that here would make thirty pages that say the same thing. The event programme template is a complete file with this block already in it, so take that and change the fragment rather than assembling one from parts. The property doing most of the work here is covered on its own page, with the support caveats that belong there rather than here.
Frequently asked
Will this fragment work on its own?
Not as a whole document. It has no page rule, no margins and no base type, because those belong to the document rather than to the block, and duplicating them in every fragment would mean thirty copies to keep in step. Paste it into a template that already has them.
Why does it look right in a browser and wrong in the PDF?
Because a browser window is one continuous surface and a document is a stack of fixed rectangles. Nothing in a scrolling view exercises a page boundary, so every break rule in the fragment is inert until the content is paginated. Render the real thing with enough content to cross two or three boundaries, then look.
Do I need a special option on the render request for this?
No. Everything on this page is CSS and markup, which is your side of the boundary. What the render has to give you is a real page size with real margins, and after that the layout is decided by the stylesheet.
Other parts of a document
The blocks that sit next to this one, and one from the next group along so you are not sealed inside a single kind of problem.
Ruled lines sized for handwriting on a printed form
An open area of ruled lines for somebody to write on, on a form completed by hand.
A colour key that still works when the page is printed in grey
A legend mapping colours to meanings, beside a chart, a plan or a coded table.
Numbered steps that stay readable when followed one handed
An ordered procedure with prominent numbers, followed by somebody holding the document while doing something else.
A meter reading table showing previous, current and consumption
Previous reading, current reading, the difference and the charge, printed for one or several meters on a utility-style bill.
Event programme, as a complete file
The whole document with this block already in place, ready to copy and change.
page (named pages) in paged output
The property carrying the weight here, with its real support status.
Every part of a document
The full list, grouped by the kind of problem the block poses.
Paste the fragment into the playground inside a page rule and see what it does at a real page size. That is the only way any of this gets confirmed.