==================== PDF style directives ==================== The PDF rendering of the document component supports a list of style directives to customize the output. Most style directives are equivalent to the CSS directives used for HTML and XML, but there are some additional directives and not all CSS directives are supported. The selectors, which can be used are documented in the tutorial__. Currently all values are required to be escaped inside quotes ("). The full grammar looks like:: File ::= Directive+ Directive ::= Address '{' Formatting* '}' Formatting ::= Name ':' '"' Value '"' ';' Name ::= [A-Za-z-]+ Value ::= [^"]+ Address ::= Element ( Rule )* Rule ::= '>'? Element Element ::= ElementName ( '.' ClassName | '#' ElementId ) ClassName ::= [A-Za-z_-]+ ElementName ::= XMLName | '*' ElementId ::= XMLName XMLName references to http://www.w3.org/TR/REC-xml/#NT-Name __ /docs/tutorials/Document#styling-the-pdf .. contents:: Table of Contents :depth: 2 All values, given as "measure" accept different units, but always default to millimeters (mm). Possible units are: - "mm", Millimeters, the default measure, if none is specified - "pt", Points, 72 points per inch - "px", Pixel, depends on the set resolution, by default also 72 points per inch - "in", Inch The unit "Points" is most common for font sizes, while millimeters or inches will probably more useful for page margins and paddings. You are free to choose any of them and can even combine different units in one tuple, like:: para { // Top margin: 12 mm; Right margin: .1 inch; Bottom margin: 10 points, // Left margin: 1 pixel margin: "12 .1in 10pt 1px"; } Font style ========== font-size: -------------------- Defines the font size of the text. Most common unit is points, so it can be used like:: para { font-size: "12pt"; } font-family: ------------------- Defines the font used to render the text. Currently only the default PDF fonts are supported, which are: - ``serif`` - ``sans-serif`` - ``monospace`` - ``Symbol`` - ``ZapfDingbats`` The option can be used like:: para { font-family: "sans-serif"; } font-weight: --------------------- The font weight defines whether a font is printed bold or normal. Unlike CSS for now only two possible values are supported: ``bold`` and ``normal``. Some drivers might support additional values, though. Usage:: emphasis { font-weight: "bold"; } font-style: