PDA

View Full Version : Retrieve Array of Bytes Representing a PDF



fsunolefan
24 Jul 2015, 10:46 AM
Utilizing ExtJS 3.2, how would I display an array of bytes that represents a pdf file utilizing a rest-full call (GET)? In other words, I want to click a button that would make a rest-ful call, the result would be an array of bytes that is the pdf, and then display the pdf.

Any feedback would be appreciated.

Thanks.

Gary Schlosberg
27 Jul 2015, 10:31 AM
Perhaps this link will help:
http://stackoverflow.com/questions/1131116/pdf-to-byte-array-and-vice-versa

fsunolefan
27 Jul 2015, 11:15 AM
Thanks for the reply.

I reviewed the information in the link provided but I guess I wasn't clear in my original post. I have the call in place that will return a byte array that represents the PDF document. What I now need is a way within ExtJs on the calling page that will display the array of bytes as the PDF document.

For example, page displays. Select some criteria, search and receive results. Button on page that, when clicked, displays PDF document. Currently, button is defined and the controller has logic the will return the array of bytes that is the PDF. I'm searching for the appropriate ExtJs logic to add to the button to display the PDF.

Hopefully, that's a little clearer than mud...