Is it possible to interact with Obsidian (PDF export) programmatically?

You need to use Pandoc to access pdf export programmatically. You can instruct Obsidian to run commands using Advanced URI or Shell commands but pdf export command itself requires configuration which you provide using the GUI. You need to emulate keyboard actions (tab, enter etc) to programmatically gain access to the native pdf export. Obsidian has incentive improving power user experience (see for example Obsidian 1.7) but we have to wait for command line printing feature (see below).