Thanks for your reply. But here my problem is a bit different.
When I click 'Save' button after the pdf is generated, the file name I get is: http___localhost_8080_abc_XYZ_PdfPrint_my_key=feee2d98e96ae3059fce2ae489 ef01&printA=false&printB=false&printC=false&printD=true&m_page=new_print pdf&m_crt=x&m_lang=en&m_a=age&mfinfo.page=i_pdfprint&mfinfo.a=ab&mfinfo. b=en&mfinfo.c=gh&mfinfo.pdf So its not taking the last part, but the full URL as the filename. This is quite strange. Can you provide some suggestion in this case? And u wanna fly to some warm place?? Go ahead, but sorry no concessions guaranteed ;-) Thanks ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Dunbar Sent: Wednesday, December 05, 2007 19:10 To: Post all your questions about iText here Subject: Re: [iText-questions] Problem in setting save filename with inlinebrowser adobe reader I see that nobody in the Adobe Forums answered you either :) The issue is that you're using standards and Adobe isn't. It appears to ignore the file name in the content disposition header. Additionally, I'm guessing that you're using URL parameters like "/something/something?filename=somefile.pdf". Is this correct? Anyhow, I made a little test that first got a PDF via the parameter way with a HttpServletRequest.getParameter() and set the content disposition. As you noticed, when I tried to save the file it used the last part of my URL as the file name. So, I changed it to use HttpServletRequest.getPathInfo() instead and it worked fine. Of course my anchor tag had to change. So I went from: (web.xml) <servlet-mapping> <servlet-name>pdfTestr</servlet-name> <url-pattern>/pdfTest</url-pattern> </servlet-mapping> (html) <a href="/pdfTest?fileName=blah.pdf">blah.pdf</a> (java) public void doGet(... String fileName = request.getParameter( "fileName" ); And changed this to: (web.xml) <servlet-mapping> <servlet-name>pdfTest</servlet-name> <url-pattern>/pdfTest/*</url-pattern> </servlet-mapping> (html) <a href="/pdfTest/blah.pdf">blah.pdf</a> (java) public void doGet(... String fileName = request.getPathInfo(); And Adobe behaved as you want. KLM huh? Colorado is cold this time of year - where can you fly me? :) Namdeo, D. - SPLXE wrote: Can some one please reply to this? This is quite urgent :-( Thanks. ________________________________ From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] On Behalf Of Namdeo, D. - SPLXE Sent: Tuesday, December 04, 2007 16:12 To: [email protected] Subject: [iText-questions] Problem in setting save filename with inlinebrowser adobe reader Hi, I am facing a problem while saving the generated pdf through a servlet using iText. After the pdf is generated, when I click Save button of Adobe Reader, the default name in the Save dialog is coming to be the full URL of the page on which pdf is generated. This is not desirable and a specific name should be taken as default while saving. Relevant Code: response.setHeader("Content-Disposition", "inline; filename=\"Internet-CheckIn-Boarding-Docs.pdf\""); response.setContentType("application/pdf"); Our specifications require the usage of "inline", therefore attachment cannot be used. Please help to solve this problem. Thanks. ********************************************************************** For information, services and offers, please visit our web site: http://www.klm.com. This e-mail and any attachment may contain confidential and privileged material intended for the addressee only. If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed, and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful. If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt. Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands, with registered number 33014286 ********************************************************************** ********************************************************************** For information, services and offers, please visit our web site: http://www.klm.com. This e-mail and any attachment may contain confidential and privileged material intended for the addressee only. If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed, and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful. If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt. Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands, with registered number 33014286 ********************************************************************** ________________________________ ------------------------------------------------------------------------ - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ________________________________ _______________________________________________ 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/ ********************************************************************** For information, services and offers, please visit our web site: http://www.klm.com. This e-mail and any attachment may contain confidential and privileged material intended for the addressee only. If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed, and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful. If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt. Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands, with registered number 33014286 **********************************************************************
<<image001.gif>>
------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________ 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/
