I create custom button for print a specific print format but it did not work

I think you misunderstood. I mean in response you will get encoded data.