canvas-export
Skill299 starsChanged 8 months agoMITView on GitHub
Export Obsidian Canvas files to PNG, SVG, or PDF formats. Uses the Advanced Canvas plugin's built-in export when Obsidian is running, or falls back to Playwright browser-based screenshot capture. Supports single canvas export, presentation slide-per-page PDF export, and batch export. Triggers on: canvas export, export canvas, canvas to png, canvas to pdf, canvas to svg, save canvas as image, screenshot canvas, export presentation.
- Installs packages
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- canvas-createSkill
- canvas-generateSkill
- canvas-layoutSkill
- canvas-populateSkill
- canvas-presentSkill
- canvasSkill
- canvas-templateSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
When Obsidian is not running or Advanced Canvas is not installed, use Playwright to capture the canvas.
- Distinctive: line 39
Check if Playwright is available:
- Distinctive: line 43
If available, generate a standalone HTML viewer of the canvas and screenshot it:
- Distinctive: line 67
When neither method is available:
- Distinctive: line 80
If provided: use it.
- Distinctive: line 83
If not available: try Method 2 (Playwright).
- Distinctive: line 84
If neither: use Method 3 (user-assisted).
- Distinctive: line 116
Create the directory if it doesn't exist.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
canvas-export: Export Canvas to Image/PDF
Export Methods
Method 1: Advanced Canvas Plugin Export (Preferred)
The Advanced Canvas plugin provides built-in PNG and SVG export with transparency support.
Requirements: Obsidian running with Advanced Canvas installed.
Workflow:
- Instruct the user: "In Obsidian, right-click the canvas background → Advanced Canvas → Export as PNG/SVG"
- Or use Obsidian's command palette:
Advanced Canvas: Export as PNG - The exported file appears in the canvas directory.
This is the highest-quality export method — it uses Obsidian's own rendering engine.
Method 2: Playwright Screenshot (Fallback)
When Obsidian is not running or Advanced Canvas is not installed, use Playwright to capture the canvas.
Requirements: Playwright installed (pip install playwright && playwright install chromium)
Workflow:
- Check if Playwright is available:
python3 -c "from playwright.sync_api import sync_playwright; print('ok')" 2>/dev/null && echo "available" || echo "not available" - If available, generate a standalone HTML viewer of the canvas and screenshot it:
# Generate HTML from canvas JSON python3 -c " import json, sys canvas = json.load(open(sys.argv[1])) # ... render to HTML with absolute positioning ... " [canvas_path] > /tmp/canvas-preview.html # Screenshot with Playwright python3 -c " from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch() page = browser.new_page(viewport={'width': 1920, 'height': 1080}) page.goto('file:///tmp/canvas-preview.html') page.screenshot(path='[output_path]', full_page=True) browser.close() " - Report the output path and dimensions.
Method 3: User-Assisted Screenshot
When neither method is available:
- Tell the user: "Open the canvas in Obsidian, zoom to fit all content, then take a screenshot."
- On Linux (COSMIC): suggest
Printkey for screenshot tool. - On macOS: suggest
Cmd+Shift+4.
Operations
Export to PNG (/canvas export png [output_path])
- Identify the target canvas (default: active canvas or
main.canvas). - Determine output path:
- If provided: use it.
- If not:
[canvas_dir]/exports/[canvas-name].png
- Try Method 1 (Advanced Canvas) first.
- If not available: try Method 2 (Playwright).
- If neither: use Method 3 (user-assisted).
- Report: "Exported [canvas] to [path] ([width]x[height] pixels)"
Export to SVG (/canvas export svg [output_path])
- Same flow as PNG, but use SVG format.
- Advanced Canvas supports SVG export with transparency.
- Playwright fallback: render HTML, use
page.screenshot(type='svg')— note: Playwright doesn't natively export SVG. Fall back to PNG. - Report format and path.
Export to PDF (/canvas export pdf [output_path])
For standard canvases:
- Export to PNG first, then convert:
convert [png] [pdf](ImageMagick).
For presentation canvases:
- Detect if canvas has edge-connected slide groups (presentation pattern).
- Export each slide group as a separate PNG.
- Combine into a multi-page PDF:
convert slide-1.png slide-2.png slide-3.png output.pdf - Report: "Exported [N]-slide presentation to [path]"
Output Directory Convention
Exports go to [canvas_dir]/exports/ by default:
- Vault mode:
wiki/canvases/exports/ - Standalone mode:
.canvases/exports/
Create the directory if it doesn't exist.
Limitations
- Playwright rendering is approximate — it doesn't replicate Obsidian's exact canvas renderer
- SVG export via Playwright is not supported — falls back to PNG
- PDF export requires ImageMagick (
convertcommand) - Mermaid diagrams in text nodes may not render in Playwright screenshots (requires Mermaid JS library)
- GIF animations are captured as static frames in screenshots
- Export quality depends on the method used (Advanced Canvas > Playwright > Screenshot)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

