How to control save as option in a jsp whose content type is PDF

Hi
I have one jsp in which i am showing PDF, it means it content type is PDF. I want to control save as option in it,
i.e when a user tries to save it the default name which is coming it is name of the jsp, but i want default name is dynamic which depends upon user.
I used response.setHeader(content-deposition,inline;filename=abcd.pdf) , but it doesnt work. if i use
response.setHeader(content-deposition,attachment;filename=abcd.pdf) then it is working but it straight away giving option as "U want to open or want to save it". I dont want this i want first PDF to be shown in jsp then if some one wants to save he will click on save button in PDF and there and want this option.
Kindly help me

Don't use JSP to serve a binary file. It almost implies the use of awful scriptlets and the invocation of both the response writer and the response outputstream which would only lead to IllegalStateException headaches in the server logs.
Use a Servlet instead. Specify the file name as request parameter and let the servlet read the file and write it to the outputstream of the response.

Similar Messages

  • How to remove save, cancel option when end user runs the workbook in Portal

    Hi,
    how to remove save, cancel option when end user runs the workbook and make some small changes like using page items or increasing rows and columns
    I already made 2 changes
    1) I removed the option in Oracle Enterprise Manager under discoverer viewer of saving
    2) I also removed the option of Allow saving changes made in Viewer when adding workbook to portal
    But still the end user gets options of saving when made small changes to workbook like increasing rows and columns
    Is their any place, I need to make changes?
    Thanks in Advance
    Rowdheer

    Don't use JSP to serve a binary file. It almost implies the use of awful scriptlets and the invocation of both the response writer and the response outputstream which would only lead to IllegalStateException headaches in the server logs.
    Use a Servlet instead. Specify the file name as request parameter and let the servlet read the file and write it to the outputstream of the response.

  • I download itext  for convert jsp to PDF. How to set content type for PDF.

    I download itext for convert jsp to PDF. How to set content type for PDF. I try
    <%@ page contentType = "application/pdf;charset=TIS-620" %>
    , but the page does not PDF.
    Thank.

    PDF files are usually binary files, JSPs are not well-suited for binary content.
    (If you download the result of your JSP you'll see that it is not a valid PDF file; it will have probably a lot of whitespace and linefeeds, that will choke your PDF reader.). The first few characters must be
    "%PDF-" without whitespace.
    You can try using PDF files encoded as text - check if you can use text-encoded PDFs in iText.
    Try using a Servlet instead.

  • HOW TO ACTIVATE SAVE LAYOUT OPTION IN VA05 T CODE

    Dear Genios,
    i am facing probel to activate the save layout option in any sap standard reports.
    I want to create & save a layout in standard report va05.
    please help me for the same.
    Regards
    Rabin Nayak

    Go to SU01/SU3 ( to ur ID) select parameters tab and then scrol down and press F4 select SD_VARIANT_MAINTAIN and in the next field select A or X then try it will allow u to save ur own variant.(the save icon come to screen variant selection screen)
    More on this:
    By default, SAP user can't save report layout in some SAP SD t-code such as: VA05 and SDO1. The 'save' menu will be grey. But, you actually can save the layout by adding a parameter in your SAP user profile. You do that with t-code: SU3. Go to 'parameters' tab and add new parameter id, which is: SD_VARIANT_MAINTAIN'. The parameter value for that is 'A'. Then save your user profile and try again to save layout in VA05 or SDO1 t-code.
    Regards,
    Sanjeev

  • How to record SAVE AS option in BDC

    HI,
        I am trying to create a Utility program which will download all the Z* -SMARTFORMS from the System on the Presentation server.
    I am recording a BDC for the Same.During record I am following steps like
    1- Tcode - SMARTFROMS
    2- Utlitities -> Download form
    3- Form Name
    4- Path to download
    But in the recording the SAVE button is not getting recorded, I guess as that is a window call from SAP so it is not getting recorded.
    So when I run the BDC for in BAckground mode - the Pop to save each and every file comes up..It is any way to automate the SAVE AS option in BDC or is there any other option.
    Basically I dont want any Human Intervien for saving activity.
    Regards
    Sandeep

    Thanks for your replies..
    I even tried running the program in E mode...it is still showing the SAVE option screen
    Is there any other way of downloading smartforms programatically...As basic requirement of Utlility is Mass download of smartforms.
    Can you suggest me some other way if possile?

  • How to disable save as option in forefox when we right click on the image?

    Hi Folks,
    Can somebody help to disable save as option when i right click on the image which is showing in the browser.

    Hi,
    '''sorry,it is impossible by code'''
    you can use addons.
    or
    you can disable while developing webpage using:
    <script language="javascript">
    document.onmousedown=disableclick;
    status="Right Click Disabled";
    Function disableclick(event)
    if(event.button==2)
    alert(status);
    return false;
    </script>
    Regards
    '''Deepak Krishnan'''

  • How to display the image while set custom header "x-content-type-options" as "nosniff" in web.config

    Hi,
    I am using Microsoft ASP.NET TreeView control where I have bound embedded images. Also I have set custom header “x-content-type-options” as
    “nosniff” in web.config file.
    On hosting the sample containing the above mentioned things in SERVER machine, the images are not visible but its working properly while running sample in local (development) machine. 
    Kindly provide a solution and find the sample in the below link.
    http://goo.gl/6uR2b0 
    Thanks,
    Alagarsamy D.

    Hi AlagarBala,
    Your issue is related to asp.net/web technology and for a better support on this please post your question to the asp.net forum below, this forum is for C# code issues in speicific:
    http://forums.asp.net/
    Regards,
    Fouad Roumieh

  • New option to open custom Excel content type in Excel Web Access

    Hi,
    This question is specifically for Sharepoint Online if that affects the possible solution.
    I would like a custom content type with Excel template to open up in Excel Web Access when a library's New>"My Content Type" option is chosen.  I have configured the content type (deriving from "Document"), pointed it to the spreadsheet
    template I've uploaded, added the content type to the library and set the library to "Open documents in the browser".
    However when I choose the new option for the content type it always opens it in the Excel desktop client.  If I then save the document to the library, then it does view and edit in Excel Web App after that.
    Is there any way for the initial "New" Excel document to start editing in Excel Web App?
    Thanks in advance,
    Peter

    Make sure Office 2011 is fully updated. It shouldn't have a problem opening those documents.
    When I open a 97 - 2004 workbook, it states that it needs to be converted. That may be what is crashing on your copy of Office.
    Have you tried creating a new account and see if you can open them there.

  • How to use custom aspx page as template for custom content type

    Hi,
    I have created custom content type and custom aspx page. I want to use aspx page as template for custom content type.
    Can anybody please let me know how to accomplish this?
    Any help would be appreciated.
    Thank you,
    AA.

    Check if you are looking for the below
    http://www.sharepointpals.com/post/How-to-Create-a-Page-Layout-(PageLayout)-with-ContentType-in-SharePoint-2013
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How can I add Adobe Acrobat into my Applications under content type so I can open up pdfs in a firefox window?

    firefox won't open pdf's in a new window. I get a blank page. When viewing my application options, Adobe Acrobat is not listed under content type anywhere. I entered about:plugins in the address bar and it is showing that I do in fact have Adobe acrobat.
    File: nppdf32.dll
    Version: 7.0.8.218
    Adobe Acrobat Plug-In Version 7.00 for Netscape
    I also know I have it, because I have no problem using it in IE.
    What can I do to get pdfs to open in a firefox window?

    Thanks. That worked.
    I went to the profiles directory by putting %APPDATA% in the run window, then in explorer went to mozilla, firefox, profiles, and deleted the mimeTypes.rdf file after making sure firefox was closed. Opened firefox again and mailto links worked. Tried it on my friend's computer and it work on it as well.

  • How to control required and optional data elements

    I am developing a web service using a stateless EJB. By default, when I use servicegen, the WSDL contains nillable="true" for all elements. How can I modify my EJB code so I can specify which elements are required vs optional?
    Thanks.

    Hi,
    Use Function Module READ_TEXT to retrive the long text.
    Pass below values for parameters
    text name - <data element name>
    text id - 'TX'.
    text object - 'DOKU'.
    <b>Reward points for helpful answers</b>
    Satish
    Message was edited by:
            Satish Panakala

  • How can I save user options

    Hello guys
    Is there any way to save the users preferences in my application for later use?
    for example the user clicks tools >> options. and there he/she choose one of three choices and this choice must be saved for the next use.

    true. But that doesn't represent a user on the
    serverside.
    Many computers are used by more than one person under
    the same login, in which case those would all share
    the same options for the web application as set by
    the last one changing them from that terminal.
    On another terminal their settings would be
    different.
    By storing the information on the server they'd
    always get their own settings, not just when using
    their private machine but also when visiting
    elsewhere.If all users work under one userid on the client computer (or the server ignores the client id), then the only way your approach works is to maintain a full user database on the server with each user's id, passwords, preferences, and validation routines, and require that every user log on for each access of the server. In most cases, a single session involves multiple server accesses during a transaction, which would be impossible to handle correctly.
    This is not a good approach from both the security aspect - each user should be logging on to the client machine using their own userid - and the usability aspect.
    I recommend against this approach.

  • How to disable SAVE AS option while opening PDF in browser in OAF

    Hi All,
    We have created a page with MessageTextInput fields. All the datas are captured and export into PDF format. We have done this through XML publisher. PDF will be generated when we click on Generate button. PDF is getting opened in the IE browser.
    The user should not save the PDF, so we need to disable the save as functionality of browser.
    Thanks and Regards,
    Myvizhi

    On your Print window (CTRL+P '''''or''''' ''Firefox button > Print'' '''''or''''' ''File > Print''):
    #be sure your correct printer is seclected
    #be sure "Print to file" is '''''not''''' checked
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *'''''Adobe Shockwave for Director Netscape plug-in''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.org/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.org/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.org/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • How to add/change Job Options when saving a FrameMaker document as a PDF using Acrobat 9

    If you are logged on as a domain user you could have a problem if you want to add or edit .joboption files in Distiller 9 when it is opened by FrameMaker.
    After installing Acrobat 9 the action of saving a FrameMaker document as a PDF automatically starts Distiller 9 which then uses the "Job Options" files that are located in C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF\Settings. Unless some changes have been made to the "Security" settings of the "Adobe" folder and the "Adobe PDF" folder under "All Users" it will not be possible to add or edit ".joboption" files in the "Settings" folder located in that "Adobe PDF" folder.
    This can be confusing because when Distiller 9 is started separately, from Programs, it then uses the job options located in your own user folder (C:\Documents and Settings\NLPW\Application Data\Adobe\Adobe PDF\Settings). In your own user folder (in my case: NLPW) you can add or edit the job option files.
    In order to be able to add or edit job option files under "All Users" you must be included in the "All Users" list and have the appropriate "Permissions" security setting. To set this, right click on the "Adobe" folder (C:\Documents and Settings\All Users\Application Data\Adobe) and select "Properties", then click on the "Security" tab and add yourself to the list. Finally, (important) check the "Full Control" box under "Allow" in the permissions field. Repeat this procedure on the "Adobe PDF" folder (C:\Documents and Settings\All Users\Application Data\Adobe\Adobe PDF). Now you have the ability to add or edit ".joboption" files located in the "Settings" folder and these will be available when Distiller is started by FrameMaker.

    Thank you so much for that tip. I don’t have exactly the same set-up (FrameMaker 8, Acrobat 8 Professional), but changing the permissions as you describe fixed the problem of not being able to save or change Distiller job options which has been bothering me for a while.

  • How do I save a 5x7 doc to print 2-up as a pdf?

    I am designing invites for my sister, who wants to print them at home (I normally send a pdf to an online printer), and it would be economical for her to print 2-up, but I cannot figure out how to save my work and allow for that.
    My work is a 5x7 artboard with 0.125 bleed in Illustrator. I know how to convert to a PDF with crop marks for online printers, but how do I get 2 on the page for my sis to print at home?
    Apologies in advance if this is a silly question, but its driving me bonkers...

    Yes.  Acrobat will set crops to whatever your artboard size is, which would be the 7x10 ( no split ).  You should have enough space to print on a standard 8.5x11 sheet, including an 1/8" bleed and 1/4" trim marks.  When you create your own trim marks, you have to use an 8.5x11 artboard, instead of the 7x10.  I usually add an invisible holding line ( no fill, no stroke ) to the artboard size ( 8.5x11) and lock it so the PDF is the entire 8.5x11.  Not really a big deal, I create all of my own trim marks this way, part of the workflow.

Maybe you are looking for

  • Installing Adobe Acrobat 8.0

    I have Adobe Acrobat 5.0. My computer crashed a few days ago. Before it crashed I had updated to Adobe Acrobat 8.0 (and honestly I do not know how I updated, but I did) Anyway, the computer crashed and after fixing it it would not convert any documen

  • CS4 apps on different drives

    When I got CS4, I installed several apps on an external drive. Works fine. I now want to install other parts of the suite on another (internal) drive, but Setup shows the original install location only. I see no way to choose a different location. Am

  • Enhancement PPCO0012 (exit for TCode CO01)

    Hi, I'm using screen exit mentioned in enhancement PPCO0012 for TCode CO01. Since the screen-exit triggers at header level I am unable to do the required manupilations. I need to add some functionality at the header level for the component data, but

  • "Error: Out of memory"

    Getting this error message when I try rendering or exporting a sequence (ProResHQ 720 25p). I have 3 sequences, each about an hour long. The only unrendered clips (and they are very few) are some minor cropping; some cross dissolve transitions and so

  • After Database migration,workflow mailer is not getting up

    After database migration, our workflow mailer is not getting up. Application version : 12.0.6 DB version: 11.2.0.2 Should we rebuild the workflow queues after migration.Please help!!!!!