0
votes

I have web application in which there datgrid inside there on last column there is pdf icon. On click of that i get pdf file byte array.

Now, i want to open that pdf in pdf reader/viewer at client side.

For that i have downloaded it as pdf like:

var fR:FileReference = new FileReference();
fR.save(byteArray,"test.pdf");

But, i can't open that pdf in inside viewer. I have searched lots of things but didn't get any solution for that.

My aim is to open pdf file at client side from bytearray which got in response.

Any help would be greatly appreciated.

2
You can't do that from a web app but you can open it in a browser as a link. - BotMaster
@BotMaster But, i got bytearray from the server response then how can i open it as a link. - ketan

2 Answers

2
votes

But, i can't open that pdf in inside viewer.

I'm glad you can't. Otherwise, every flash file that's running on a website could start applications on my computer and wreak havoc.

Your intentions may be good, but those of others aren't. That's why security policies and sandboxes are in place.

If you want that kind of access to a client computer, you should build a desktop application with Air.

0
votes

In the Flash Player you can't open the PDF from a ByteArray response. What you can do is have your server respond with an actual PDF document and navigate the user's browser to the PDF URL using navigateToURL(). This is up to the client's browser, but in many cases the browser will allow the user to view the PDF or open the PDF in a viewer app.