Public Vars

Back

print-page (clj)

(source)

multimethod

(print-page driver file) (print-page driver file opts)
Have `driver` print current HTML page to `file` in PDF format. `file` can be either a string or `java.io.File`, any missing parent directories are automatically created. `opts` map is optional: - `:orientation` is `:landscape` or `:portrait` (default) - `:scale` a number, defaults to `1`, min of `0.1`, max of `2` - `:background` defaults to `false` - `:page` (default is North American Letter size 8.5x11 inches) - `:width` in cm, defaults to `21.59` - `:height` in cm, defaults to `27.94` - `:margin` - `:top` in cm, defaults to`1` - `:bottom` in cm, defaults to `1` - `:left` in cm, defaults to `1` - `:right` in cm, default to `1` - `:shrinkToFit` defaults to `true` - `:pageRanges` a vector, 1-based pages to include, example `["1-3" "6"]` or `[]` for all (default) At the time of this writing current WebDriver support: - chrome, works in headless mode only, supports all opts - edge, works in headless only, supports all opts - firefox, might not support all opts - safari, feature is not implemented

Examples