How can I get ledger statement for a particular contact?

How can I get ledger statement for a particular contact?

I am trying to fetch the ledger statement for a given contact id but it returns the response  in the form of pdf, so is there any way to get the response in text (json) format?