Skip to content

Global Settings

Configure default options for all PDF exports in your Zed settings.json.

Configuration Location

Add settings under context_servers.markdown-pdf.settings:

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        // Your settings here
      }
    }
  }
}

Complete Example

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        "page_format": "A4",
        "orientation": "portrait",
        "scale": 1,
        "print_background": true,
        "margin": {
          "top": "20mm",
          "right": "15mm",
          "bottom": "20mm",
          "left": "15mm"
        },
        "font_family": "Georgia, serif",
        "include_default_styles": true,
        "highlight": true,
        "highlight_style": "github.css",
        "emoji": true,
        "open_after_export": false,
        "header": {
          "height": "15mm",
          "left_image": "./logo.svg",
          "left_image_height": "12mm",
          "center_text": "{title}",
          "right_text": "{date:MMMM d, yyyy}"
        },
        "footer": {
          "height": "10mm",
          "center_text": "Page {page} of {pages}"
        }
      }
    }
  }
}

Page Settings

page_format

Paper size for the PDF.

ValueDescription
"A4"210 × 297 mm (default)
"Letter"8.5 × 11 inches
"Legal"8.5 × 14 inches
"Tabloid"11 × 17 inches
"A3"297 × 420 mm
"A5"148 × 210 mm
json
{ "page_format": "Letter" }

orientation

Page orientation.

ValueDescription
"portrait"Vertical (default)
"landscape"Horizontal
json
{ "orientation": "landscape" }

scale

Zoom factor for page rendering.

  • Type: number
  • Range: 0.1 to 2
  • Default: 1
json
{ "scale": 0.9 }

margin

Page margins as CSS length values.

json
{
  "margin": {
    "top": "20mm",
    "right": "15mm",
    "bottom": "20mm",
    "left": "15mm"
  }
}

Supported units: mm, cm, in, px, pt

page_ranges

Print only specific pages.

  • Type: string
  • Default: "" (all pages)
json
{ "page_ranges": "1-5, 8, 10-12" }

Include background colors and images.

  • Type: boolean
  • Default: true
json
{ "print_background": true }

Content Settings

font_family

CSS font-family for the document body and header/footer.

  • Type: string | null
  • Default: null (system fonts)
json
{ "font_family": "Georgia, 'Times New Roman', serif" }

include_default_styles

Include the built-in neutral stylesheet.

  • Type: boolean
  • Default: true
json
{ "include_default_styles": false }

Set to false to use only your custom stylesheet.

stylesheet_path

Path to a custom CSS file.

  • Type: string | null
  • Default: null
json
{ "stylesheet_path": "./styles/custom.css" }

Relative paths are resolved from the Markdown file's directory.

breaks

Convert single newlines to <br> elements.

  • Type: boolean
  • Default: false
json
{ "breaks": true }

emoji

Render emoji shortcodes (:smile: → 😄).

  • Type: boolean
  • Default: true
json
{ "emoji": true }

Syntax Highlighting

highlight

Enable syntax highlighting for code blocks.

  • Type: boolean
  • Default: true
json
{ "highlight": true }

highlight_style

Highlight.js theme filename.

  • Type: string
  • Default: "github.css"
json
{ "highlight_style": "atom-one-dark.css" }

Popular themes:

ThemeStyle
github.cssLight GitHub (default)
github-dark.cssDark GitHub
monokai.cssClassic Monokai
atom-one-dark.cssAtom One Dark
nord.cssNord
vs.cssVS Light
vs2015.cssVS Dark

Browse all themes at highlightjs.org/demo.

Structured header configuration.

  • Type: object | null
  • Default: null
json
{
  "header": {
    "height": "15mm",
    "padding": "0 10mm",
    "font_size": "9px",
    "left": { "type": "image", "src": "./logo.svg", "height": "12mm" },
    "center": { "type": "title" },
    "right": { "type": "date", "format": "MMMM d, yyyy" }
  }
}

See Header & Footer for complete documentation.

Structured footer configuration.

  • Type: object | null
  • Default: null
json
{
  "footer": {
    "height": "10mm",
    "center": { "type": "text", "content": "Page {page} of {pages}" }
  }
}

Shorthand Syntax

For simple headers/footers:

json
{
  "header": {
    "height": "15mm",
    "left_image": "./logo.svg",
    "left_image_height": "12mm",
    "center_text": "{title}",
    "right_text": "{date:yyyy-MM-dd}"
  }
}

Output Settings

assets_directory

Global directory for shared assets (images, logos). Supports ~ for home directory.

  • Type: string | null
  • Default: null
json
{ "assets_directory": "~/.config/zed-markdown-pdf/assets" }

Paths starting with @/ in image sources are resolved relative to this directory:

json
{
  "assets_directory": "~/.config/zed-markdown-pdf/assets",
  "header": {
    "left_image": "@/company-logo.svg"
  }
}

The ~ expands to your home directory on all platforms:

  • macOS/Linux: $HOME (e.g., /Users/john)
  • Windows: %USERPROFILE% (e.g., C:\Users\john)

output_directory

Default directory for output PDFs.

  • Type: string | null
  • Default: null (same directory as source)
json
{ "output_directory": "./build" }

open_after_export

Open the PDF in the default viewer after export.

  • Type: boolean
  • Default: false
json
{ "open_after_export": true }

Priority Order

Settings are applied in this order (later overrides earlier):

  1. Extension defaults — Built-in sensible defaults
  2. Global settings — Your settings.json configuration
  3. Front matter — Per-document pdf: block
  4. Tool arguments — Options passed in the prompt

Minimal Configuration

A minimal setup with header and footer:

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        "header": {
          "center_text": "{title}",
          "right_text": "{date:yyyy-MM-dd}"
        },
        "footer": {
          "center_text": "Page {page} of {pages}"
        }
      }
    }
  }
}

Organization-Wide Settings

For consistent branding across all documents, use the global assets directory:

json
{
  "context_servers": {
    "markdown-pdf": {
      "settings": {
        "assets_directory": "~/.config/zed-markdown-pdf/assets",
        "font_family": "Helvetica, Arial, sans-serif",
        "header": {
          "height": "20mm",
          "padding": "0 15mm",
          "border_bottom": "2px solid #0066cc",
          "left_image": "@/logos/company-logo.svg",
          "left_image_height": "15mm",
          "right_text": "{date:MMMM d, yyyy}"
        },
        "footer": {
          "height": "12mm",
          "padding": "0 15mm",
          "font_size": "8px",
          "color": "#666",
          "left_text": "© 2025 Company Name",
          "center_text": "Page {page} of {pages}",
          "right_text": "Confidential"
        }
      }
    }
  }
}

Each team member places their copy of the brand assets in the configured assets_directory.

Team Setup

Share a ZIP of your brand assets with team members. They extract it to ~/.config/zed-markdown-pdf/assets/ and the same settings work for everyone.

Next Steps

Released under the MIT License.