Forum Documentation

Syntax for media size

Hello, I'm new to Prince, and I'm trying out stuff -- I hope the product will live up to my expectations :)

In general I try to make my print CSSs 'responsive', i.e. documents should print adapting as much as possible to media size. Obviously, the ability to generate PDFs with different media sizes from Prince comes in very handy for that, so that specific page dimensions can be avoided as much as possible within the CSS.

However, the docs apparently do not specify the syntax for media size -- all I could find in the command line reference is:

Specify the page size (eg. A4).

which is well and good if you're printing to A4, but I am not. How should other (custom) dimensions be specified*? Also, is it enough to swap dimensions to switch the default orientation between portrait and landscape?

*For example, I usually print to 15.5x19cm paged media, which is not any of your usual DIN sizes.

It is the same as the "size" property in @page rules, which can take two values for horizontal and vertical dimensions:
@page {
    size: 155mm 190mm
Thank you for the quick reply, but how is that to be written in the command line, between quotes (i.e. --page-size="155mm 190mm"), as is ( --page-size=155mm 190mm), or...?
Yes between quotes as a single argument.
Cool, thank you!