Capture
bl pdf
Save page as PDF
Save page as PDF
Usage
bl pdf [url] [OPTIONS]Arguments
| Argument | Description |
|---|---|
[url] | URL to navigate to before saving |
Options
| Option | Description |
|---|---|
-o, --output <value> | Output file path (default page.pdf) |
--background | Print background graphics |
--orientation <value> | Page orientation (default: portrait) |
--scale <value> | Print scale, 0.1-2.0 (default: 1.0) |
--no-shrink-to-fit | Don't shrink content to fit the page width |
--margin <value> | All four margins in cm (default: 1.0) |
--margin-top <value> | Top margin in cm (overrides --margin) |
--margin-right <value> | Right margin in cm (overrides --margin) |
--margin-bottom <value> | Bottom margin in cm (overrides --margin) |
--margin-left <value> | Left margin in cm (overrides --margin) |
--page-width <value> | Page width in cm (default: 21.59) |
--page-height <value> | Page height in cm (default: 27.94) |
--page-range <value> | Pages to print, e.g. 1 or 2-4 (repeatable; default: all pages) |
--json | Output as JSON |
--session <value> | Run this command in the named session (env: BL_SESSION; default: "default") |
Global options
| Option | Description |
|---|---|
-v, --verbose | Enable debug logging |
Examples
bl pdf -o page.pdf
# Save current page as PDF
bl pdf https://example.com -o page.pdf
# Navigate to URL first, then save as PDF
bl pdf -o report.pdf --orientation landscape --background
# Landscape, with background graphics
bl pdf -o invoice.pdf --page-range 1 --margin 0.5
# First page only, 0.5cm margins all around