Skip to content

bleed not working as expected with --preflight-option boundary-boxes #710

@cmahnke

Description

@cmahnke

I've added a bleed to my page definition like this:

@page  {
  size: 210mm 210mm !important;
  margin-top: 1cm;
  margin-bottom: 1cm;
  bleed: 3mm;
  /* marks: crop cross; */
}

The @page decleration is incomplete here since the left and right margins, are dependend on settings for the left and right page.

After Running npx vivliostyle build --preflight press-ready --preflight-option boundary-boxes --language de docs/print.html -o print-press-ready.pdf the result is in part off.

This works in part, as the output of pdfinfo -box print-press-ready.pdf shows:

Title:           Kleiderbügel
Author:          Christian Mahnke
Creator:         Vivliostyle (Vivliostyle.js 2.39.1; Chrome/143.0.7499.42)
Producer:        GPL Ghostscript 10.05.1
CreationDate:    Mon Dec 29 21:33:23 2025 CET
ModDate:         Mon Dec 29 21:33:23 2025 CET
Custom Metadata: yes
Metadata Stream: no
Tagged:          no
UserProperties:  no
Suspects:        no
Form:            none
JavaScript:      no
Pages:           344
Encrypted:       no
Page size:       612.28 x 612.28 pts
Page rot:        0
MediaBox:            0.00     0.00   612.28   612.28
CropBox:             0.00     0.00   612.28   612.28
BleedBox:            0.00     0.00   612.28   612.28
TrimBox:             0.00     0.00   612.28   612.28
ArtBox:              0.00     0.00   612.28   612.28
File size:       703998827 bytes
Optimized:       no
PDF version:     1.3
PDF subtype:    PDF/X-1:2001
    Title:         ISO 15930 - Electronic document file format for prepress digital data exchange (PDF/X)
    Abbreviation:  PDF/X-1:2001
    Subtitle:      Part 1: Complete exchange using CMYK data (PDF/X-1 and PDF/X-1a)
    Standard:      ISO 15930-1

If I'm not completely wrong bleed is applied half way, since having just the 210mm would result in a width of 603.78pt, so having 612.28 seems to be right here. The problem is that the Box section doesn't seem to reflect this. At least one of BleedBox, CropBox TrimBox or ArtBox should be smaller. Since Paged Media doesn't seem to follow the PDF nomenclature / conventions here I'm not sure which of those it should be, certainly the TrimBox. I know this sounds confusing but according to 7.3. Bleed Area: the bleed property it's defined as

This property specifies the extent of the bleed area outside the page box; in other words the extent beyond the page box at which the page rendering is clipped. Values have the following meanings

Which means that bleed to be the area / box where bleed can happen which in turn implies that at least in this case where bleed is larger then the page size the TrimBox need to be set to 8.5 8.5 603.78 603.78.

Update

It works when not using --preflight-option boundary-boxes:

MediaBox:            0.00     0.00   612.28   612.28
CropBox:             0.00     0.00   612.28   612.28
BleedBox:            0.00     0.00   612.28   612.28
TrimBox:             8.50     8.50   603.78   603.78
ArtBox:              0.00     0.00   612.28   612.28

TheArtBox can be considered an artifact of pdfinfo if there isn't one:

cpdf print-press-ready.pdf 1 -page-info
Page 1:
Label: 
MediaBox: 0.000000 0.000000 612.280000 612.280000
CropBox: 
BleedBox: 0.000000 0.000000 612.280000 612.280000
TrimBox: 8.503900 8.503900 603.779000 603.779000
ArtBox: 
Rotation: 0
Annotations: 0

So this can be addressed later, if ever, maybe it needs to be documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions