File Path Not Recognized

File Path Not Recognized

Forum member · Jun 11, 2007
We're trying to specify the file name that is used if a user attempts to save a dynamic PDF we generate, but the file name doesn't appear to be recognized. Here's the code we're using: doc.drawToWeb(req, res, sOut, "test.pdf"); But when we try to save the file, the name that shows up by default is servlet_name.pdf. Our understanding is that using the drawToWeb method with the name specified as the last parameter would use this file when saving/downloading. Any assistance would be great.

Re: File Path Not Recognized

Support · Jun 12, 2007
Hello, It is not possible to have control over the window title as well as the "Save a Copy" file name from within Acrobat. It will automatically inherit the filename of the class. In order to have control over the filename while saving the PDF, you will have to use the overloaded DrawToWeb constructor that takes filename and also forces the user to download the file by setting the forceDownload parameter to true; else it is not possible and the default name will be the name of your class or servlet. drawToWeb(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream sOut, java.lang.String downloadAsFileName, boolean forceDownload) Thanks, ceTe Software Support Team.

Re: File Path Not Recognized

Forum member · Jun 13, 2007
So you're saying that the drawToWeb method that only takes a download filename but not a force indicator or one that has a force indicator = false will have no impact on the filename it tries to save as?

Re: File Path Not Recognized

Support · Jun 13, 2007
The DrawToWeb method that takes only a string or the DrawToWeb method that takes a string and a forceDownload = false only impact the file name of the PDF if that PDF is forced to be saved from the browser before the PDF plug-in is loaded (like if the user right clicks on a link and selects "Save Target As..."). In both of the above mentioned cases, once the PDF plug-in is loaded, the name of the PDF will be pulled (by the PDF reader) directly from the name of the servlet. There is no control over the name at that point. Thanks, ceTe Software Support Team