Well, first of all, according to the man page, you need to specify a display or a compiled keyboard definition file to print. Try it with "
xkbprint -o layout.ps :0".
Beyond that, a little bit of searching on Google turned up a comment or two suggesting that there was a recent bug that caused the same error, but I haven't confirmed it.
Strangely enough, it's not working on one of my two systems, but it is working on the other. I made sure they're both running the most recent version of xkbprint (in Debian it's provided by the
x11-xkb-utils package), so I guess the source of the problem probably lies somewhere deeper in the x-server. I'm not going to try updating everything right now to check, however.