>From my experience, the "Content-Disposition" header works when you are saving 
>directly to disk.  If you open it in a reader first, then it is up to that 
>reader how it saves.  Based on the info presented, he is probably running in 
>an Apache environment, so I am not sure how what I am about to suggest 
>applies.  I run in a controlled Windows (IIS, IE, etc...) environment and we 
>use Adobe Reader.  Reader uses the end of the URL as the default name of the 
>file.  The way I resolved this was to set up a HTTP handler such that it 
>intercepts anything with something like "http://server/printable/"; in the URL. 
> You could then set the URL to be 
>"http://server/printable/filenameiwant.ashx";.  When you hit the save-as button 
>in Reader, it would then auto-fill the file name with "filenameiwant". 

So I would recommend Googling "Apache http handler". ;)  I hope this helps!

Thanks, 

Brian

-----Original Message-----

Message: 9
Date: Wed, 26 May 2010 08:49:21 +0200
From: 1T3XT info <[email protected]>
Subject: Re: [iText-questions] How to set the pdf's name dynamically
        when using      servlet
To: Post all your questions about iText here
        <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Zhu, Yunpu wrote:
> I wanna decide pdf's name dynamically when I generate the pdf file using 
> a servlet and Jsp. The pdf is shown in browser. When I click save as, 
> the pop-up name is different during the different scenario.

That's not an iText question.
The name of the file is defined in the HTTP header
(Google for "Content-Disposition").
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to