Thanks Ian, I had tried this way, but what how should I post my data in textarea to the server side? I encounter like SOP errors, for my tomcat runs on port 8080, while GWT on 8888, I also tried to set in the same port 8888, won't work, can you teach me how to configure or set in detail, I am doing this for my project, thanks for a lot! Regards.
On 2月17日, 上午12时34分, Ian Petersen <[email protected]> wrote: > On Mon, Feb 16, 2009 at 4:05 PM, koko <[email protected]> wrote: > > I have a problem with converting byte array to pdf file, this will be > > processing in the client side. > > in my project the PDF file was constructed by the content in the > > textarea which user type in, after user press PDF button it will > > trigger RPC call and get byte array response from server side, > > actually it was a PDF file, I want to shown it to the user and let > > them download. > > Now after RPC byte array was stored in variable called result, what > > should I do next? Can anyone help me please.. > > That approach won't work. To serve a PDF to the user, write a servlet > that spits out the PDF, annotated with the appropriate Content-Type > header. When the user presses the PDF button, either open a new > window or display an iframe and, in either case, set the URL for the > new window to be the address of your PDF-generating servlet. If you > want to prompt the user to save the PDF to disk rather than displaying > it the browser, set the Content-Disposition header appropriately. (I > forget what value you need there, but you should be able to find it > with a good search engine.) > > Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
