How to use xkbprint?

There are no examples in the manual and every file I've tried needs some geometry.

$ xkbcomp /usr/share/X11/xkb/symbols/ua tmp/ua.xkm

$ xkbprint tmp/ua.xkm
Cannot open "tmp/ua.xkm" to read geometry

$ xkbprint /usr/share/X11/xkb/symbols/ua
Error: Couldn't read geometry from XKM file "/usr/share/X11/xkb/symbols/ua"
Exiting

The source can be ... or an X display specification.

xkbprint :0 -o xkbprint_output.ps


To build on gioele's answer, to preview custom keyboard layout, you can also use xkbcomp like this:

setxkbmap ua -print | xkbcomp - - | xkbprint - - | ps2pdf - > ua.pdf

ua being the desired keyboard layout.

Inspect setxkbmap -print — it provides xkbcomp with geometry, symbols, keycodes, ...