I was in need of pdf2json writing to stdout and there was no way to do that properly. Also the code seems to be a mess. So i forked it.
I'm not familiar with C++ and this is, especialy after mer fiddling around, still a mess. But it delivers JSON at stdout.
Pretty straightforward.
make && make install
pdf3json <pdf-file>
This software is based on pdf2json v0.86 which is based on XPDF 3.02 and therefore licenced under GNU GPL v2