Too sad Obsidian isn’t open source (I don’t criticize—it’s the creators’ decision, after all), these things take a lot of “detective work”!
I’m working on that for several hours now, and for the life of me can’t get the PDF output right. (Enclosed files have too much left & right margin/padding, and too much vertical space in between them.) See also How to emulate @media print (for debugging PDF styling)?.