Hi
i tried using Content-Disposition type but that is also not working.
response.setHeader("Content-Disposition",
" inline; filename=RES-TMob.pdf");
but again some "dispatcher.pdf" option is coming while saving...plz let me
know if you know any option.
"Bruno Lowagie (iText)" <[EMAIL PROTECTED]> wrote:
Ramachandran wrote:
> Hi Bruno,
>
> one issue i got from my client about PDF Gen is file name .
Please don't mail questions to me personally, use the list!!!
> I have given :
> p_response.setContentType("application/pdf");
> PdfWriter writer =PdfWriter.getInstance(document,
> p_response.getOutputStream());
> in my code to open a PDF file in My Browser
>
> when we access thru browser
> http://localhost:8080/ResearchLab-TMobileProj/Dispatcher?REQUEST=VIEWPTSPDF
>
> the browser shows my PDF Correctly..but when i save that it showing
> Dispatcher.pdf....i need to keep "RES-TMob.pdf" name.
>
> I dont want to save in local and then to open...I Want my PDF to open in
> Browser then i need to save ...while saving i need file name as
> "RES-TMob.pdf" automatically.dont wanna to use newfileOStream("ffff.pdf")
This is not an iText related question.
You'll find the answer in any good book about servlets,
and in Chapter 17 of my book. You need to set the
Content-Disposition:
response.setHeader("Content-Disposition",
" inline; filename=RES-TMob.pdf");
This may not work in every browser, but it will work
for most of them. The same goes for the line:
PdfWriter writer =PdfWriter.getInstance(document,
p_response.getOutputStream());
While this line is correct, and will work for most
browser, I predict you'll have a lot of trouble with
this line, once you bring your code into production
and start using the application with a plethora of
different browsers. This is all explained in Chapter 17.
br,
Bruno
Thanks
Regards
Ramachandran K
09841917406
---------------------------------
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel
bargains.-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/