use rpc for returning pdf content