Obsidian PDF Export Automator

Obsidian PDF Export Automator Used AI

2 devlogs
9h 8m
Created by Lou

I have an Obsidian vault that I wanted to automatically and reliably export as PDFs using Obsidian’s native export. Since there's no API for this, I built a Proxmox VM-based solution that watches a Git repo for changes. When updates are detected, it uses automation (via PyAutoGUI) to trigger the export, then processes the PDFs further.

Timeline

Ship 1

Lou

2 months ago

Lou Covers 2 devlogs and 9h 8m
Lou
Lou
4h 44m 2 months ago

Works great. implemented now a remote control mechanism to toggle and a prometheus data export for use in my grafana dashboards:).
Runs still strong on my proxmox install

Update attachment
Lou
Lou
4h 23m 3 months ago

At first I ran Ubuntu but GNOME was causing issues, so I switched to Xubuntu. XFCE is lighter on resources and just way simpler and more predictable in my experience.

After a lot of troubleshooting, I first tried intercepting the native file save dialog using C, but that wasn’t feasible because of sandboxing and security restrictions. I then moved to using xdotool and pyautogui. After TONS of trial and error to get the timing and window focus right, the automation finally works. It uses the Advanced URI plugin in Obsidian to open the export dialog and the save window. Then pyautogui takes over, enters the path, and saves the PDF. Xdotool had problems reliably selecting the right window.

Obsidian tries to open the PDF afterwards, in my case in Firefox, so for now I just close the tab programmatically. Still looking into disabling that directly in Obsidian.

Now I'm onto setting up change tracking and hooking everything into systemd to run it regularly.