Opening PDF with in the browser..!

Hi,
I have written a servlet which basically reads the .pdf files from the webserver and writes them to the browser on request using OutputStream. The problem is my servlet is working fine, but it gives me the options wether to open or to save it to the disk.,which i dont want. and also it opens the file in a new window when i say open. Please give me some ideas how do i make it open in the same window with out any options when the user clicks on the link. ur help will be greatly appreciated. Thanks in advance.

Hi this will sure help u
try {
                    OutputStream out = null;
               File f = new File(configResourceBundle.getString(AdvertConstants.DIR_ADVERT_STORE_ADVERT), fileName);
               FileInputStream istr = new FileInputStream(f);
               BufferedInputStream bstr = new BufferedInputStream( istr );
               int size = (int) f.length(); // get the file size (in bytes)
               byte[] data = new byte[size]; // allocate byte array of right size
               bstr.read( data, 0, size ); // read into byte array
               bstr.close();
               response.setHeader("Cache-Control", "no-cache");
               response.setDateHeader("Expires", 0);
               response.setHeader("Pragma", "No-cache");
               response.setContentType("application/pdf");
               response.setHeader("Content-Disposition","inline; filename="+
                         configResourceBundle.getString(AdvertConstants.DIR_ADVERT_STORE_ADVERT)+
                         configResourceBundle.getString(AdvertConstants.PATH_SEPARATOR)+fileName     );
               out= response.getOutputStream();
               out.write(data);
               out.flush();
               out.close();
               }catch(Exception e ){
               e.printStackTrace();
          }

Similar Messages

  • What can I do to rectify the situation in which Firefox will not open pdf files in the browser, even though I have already used all the help suggestions to no avail?

    I have tried everything Mozilla has suggested. Still when I click on a pdf, I get the message that the browser cannot open a pdf. I have gone through the help protocol, and it does not work.
    I have uninstalled Firefox and reinstalled it, and still not able to open pdf files within the browser.
    What else do I do, except go to IE or Chrome and just leave Firefox completely???

    A possible cause is the presence of a PDF plugin from an older Adobe Reader plugin in the plugins folder in the Firefox program folder.
    See [[Troubleshooting plugins]]
    See also:<br />
    http://kb2.adobe.com/cps/405/kb405461.html - The Adobe Acrobat/Reader cannot be used to view PDF files in a browser<br />
    http://kb2.adobe.com/cps/836/cpsid_83688.html - I can’t view a PDF document in my web browser<br />

  • Can't open PDF files in the browser. I've tried every fix mentioned and it still doesn't work!!!

    I have Windows XP. Using firefox as my browser. Suddenly, I can't open PDF files in the browser. I've tried all the fixes mentioned. Nothing works!!! Checked the plugin settings, checked Adobe Reader settings.

    I already fixed it. I never exited out of Firefox before deleting the mime file. it works now.

  • How do I get Firefox to use the Adobe Acrobat 9.0 Standard plugin to open PDF docs in the browser window?

    I have Acrobat 9.0 Standard installed on my laptop and I've followed the guides provided by Adobe and Firefox for using the provided Adobe plugin file with Firefox so that I can view PDF documents in the Firefox browser window, but neither one has worked for me. I have the location of the Nppdf32.dll file (C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Browser) and Acrobat is configured to "Display PDF in browser", but whenever I open a pdf on a website, my options are still only to either open it externally with Acrobat or save it. What do I do?

    Your response identifies the issue exactly! My website is hosted by GoDaddy. I have forwarded your linked information to their tech department. The URL below my signature is the site having the problem I've outlined when attempting to access linked images.
    Thank you
    Vincent G. Flaherty, Principal
    Hamilton 1:1 Communications, LLC
    410 Fern Road
    Orwigsburg, PA 17961-9210
    Tel: (267) 261-8693
    Designed for Submarines:
    http://www.designed4submariners.com

  • Can't get Firefox to NOT open PDF files in the browser

    I would like Firefox to always ask whether I want to open or save a PDF document. Instead, it always displays the file in the browser and pops up a toolbar. In Tools/Options/Applications pdf files are not listed. However "PDF Xchange Viewer Document" (my default PDF viewer) is listed and the action is set to "Always ask"; yet it never asks. Why?

    Such actions are usually linked to a specific MIME type and if Firefox doesn't obey and ask what to do then you may have created this action for the wrong MIME type.
    *http://kb.mozillazine.org/File_types_and_download_actions

  • How can i set Adobe to open pdf from a secure website in the browser, it just pops up and asks to open save or download. we want it to just open the PDF directly in the browser with no popups, using IE 11

    Hi,
    We are running Internet explorer 11 with the latest version of Adobe Reader.
    have found when users login to a secure website and it has pdf links on there, it doesnt open these pdf directly in the browser, it wants to save them and then open them.
    is there anything we can change to allow them to be opened directly in the browser? 
    Thanks,
    Cam

    Hi campbellk19046717,
    Please refer the KB doc link mentioned below if that might help:
    Acrobat Help | Display PDF in browser | Acrobat, Reader XI
    Let me know.
    Regards,
    Anubha

  • Issue with opening pdf file from web browser

    I have Acrobat Pro ver 6 and Adobe Reader 9.1 on a computer.  when my user tries to open up a pdf from the web he is getting the following error message:
    "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a WEb Browser.  Adbe Acrobat/Reader version 8 or 9 is required.  Please exit and try again."
    What also happens is that Acrobat Pro ver 6 opens up and nothing is there.
    I am not sure why he is getting that message since Reader 9.1 is installed.
    Can any one shed some light on this for me.
    This user needs to have Acrobat and Reader on his system.  I understand that there are issues with having both.
    Also he has it set up so that any PDF is opening using the Reader 9.1.
    Thanks,

    Your PC's default reader configuration for embedded PDFs has become confused, due to multiple Adobe PDF document solutions installed on one PC.
    Solution 1:
    Go to Start > Run
    Type regedit and click OK.
    Browse to the following key: HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe
    Make sure that the correct Default data value is set for the path where Adobe Reader or Acrobat are installed.
    The default installation values are:
    "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
    or
    "C:\Program Files\adobe\acrobat 6.0\acrobat\Acrobat.exe" (not sure about this path.  Check on your PC to be sure)
    depending on whether Adobe Reader or Adobe Acrobat is installed.
    Solution 2:
    Configure the browser to use Acrobat or Adobe Reader as a helper application.
    If you are using Firefox to browse the web, you can change this setting in Firefox by going to:
    Tools > Options
    Click on the "Applications" Tab.
    The first item in the list should be "Adobe Acrobat Document".  Under the Action list, click the drop down arrow and select the application you want to read PDFs within the web browser.  Click OK, and you should be done.
    If you're using Internet Explorer to view PDFs, try the below steps.
    After you configure Acrobat or Adobe Reader as a helper application, the browser starts the helper application in a separate window and displays PDF files within that window. Acrobat and Adobe Reader both include a preference that lets you specify Acrobat or Adobe Reader as the helper application.
    To configure Acrobat or Adobe Reader as a helper application:
    Start Acrobat or Adobe Reader.
    Choose Edit > Preferences.
    Select Internet on the left.
    Deselect Display PDF In Browser Using [Acrobat application], and then click OK.
    Quit Acrobat or Adobe Reader.
    The next time you select a link to a PDF file in the browser, a dialog box asks what you would like to do with the file. If you select Open It, the browser opens the PDF file in Acrobat or Adobe Reader (the helper application); if you select Save It To Disk, the browser saves the PDF file to your hard drive.

  • Firefox won't open a PDF link in the browser, screen just shows blank.

    Firefox won't open a PDF link in the browser, when I click on the link the screen just goes to a blank blue screen.

    If using a Mac, go to the Firefox Plugins and disable the Adobe Acrobat NPAPI Plug-in, Version 10.1.3. This is a recent plugin update, and as soon as it was installed I noticed that PDFs wouldn't download.
    Location: [Menu] Tools/Add-Ons/Plugins
    I don't know what other side-effects it can create, but it solved my problem.

  • Parameters for opening PDF files in a browser

    I read some of the posts about making a text link from an html page to a specific location in a pdf document in the browser.  I set up the parameters, as I understand it, according to the document "Parameters for Opening PDF Files." The result from my test took me to the top of page 1, not to the bookmark on page 3 that I specified. See the link below. What is wrong with the parameters?
    http://www.tabardtheatre.org/YPASCfolder/2012/SummerYouthProgram2012.pdff#page=3&bookmark= anniejr
    You can also go to the website: http://www.tabardtheatre.org/audition.html and click on the text link (in blue).

    The PDF Open Parameters do not contain the option to link directly to a bookmark, as was mentioned, but I've developed a script that can add this functionality to your files. Have a look here, if you're interested: http://try67.blogspot.com/2011/06/acrobat-link-to-specific-bookmark-in.html

  • Acrobat Standard 6 and Reader 9: Outlook opens PDF with Standard

    Background: We have one PC with Acrobat Standard 6 serving well enough for creating PDF's, but we also have Reader 9 installed on that machine to open certain newer-format PDF's that we download or that are emailed to us.
    Issue: Reader 9 opens PDF's on the hard drive and PDF's online via either Internet Explorer or Firefox (so the Windows file type associations seems to be OK), but Outlook Express persists in opening PDF email attachments with Acrobat Standard 6.
    Anyone know how to fix this? (I'm fine with making changes to the Registry if that will do it.)
    --John Hupp

    I'm having a similar problem and am totally frustrated.
    I have an old version of acrobat reader 5, but today I downloaded reader 9, but when I click on .pdf files online, I get the same message saying that I need reader 8 or 9 to open files on the web.... which I have!
    I went in, after reading this thread, and made sure my 5 had the "display PDF in browser" UNCHECKED, and that it WAS checked in 9... but still no dice. For a few years now I've been unable to just click on and open pdf files online, and have been going a long route around by right clicking pdf's, clicking on "save target as", saving the files to my desktop, then opening reader 5 and going to file, open, and opening the file. What a huge pain in the butt though... all I want to do is be able to click pdf files and open them in my browser!!
    Oh, and another bizarre thing that has happened is that since installing reader 9, all the icons on every pdf file on my computer has changed to the icon windows uses for files of an unknown type. Can't figure out why since when I double click any of these files, they open right up in reader 9.
    I'm beyond irritated with trying to figure this out, so I'm open to any suggestions anyone has!

  • I cannot open pdf files in my browser

    Adobe Reader 10.1.1 will not open pdf files from the web.  Operating system:  Mac OS X 10.6.6.  No problem with previously downloaded files.

    Hi Vikram,
    I have this trouble in Firefox, and Safari, and Chrome. I can no longer open .pdf documennts on line in any browser configuration.
    I have tried serveral browser versions and serveral Reader versions, same result. Running Mac OS 10.6.8, just after a full rebuild and this is the most annoying result.
    I do have the above suggestion checked, which I believe is the default setting, as I was always able to use a single cilck to open all .pdf files. Noticed this first with download of most current Reader. Currently have 9.5.2.
    It began when I installed most current version after the rebuild of the OS.
    Any help would be gratefully appeciated.
    Thanks,
    Jay

  • Firefox not opening PDF with Adobe Reader for Mac

    I can't open PDF in Firefox with Adobe Reader for Mac, what should i do?

    I have come across this problem, but i have solved my problem. The default PDF viewer with Firefox browser on Mac is Preview, so you can't use adobe reader to open PDF files, if you want to use Adobe Reader to open pdf with Firefox on mac, you need set adobe reader as your mac's default pdf viewer. Do as follows:
    1. Select any PDF file and choose File > Get Info.
    2. Choose Adobe Reader as your default PDF files viewer from the Browser in Download Action window.
    3. Click OK to set Adobe Reader as your default PDF files viewer.
    If you want to learn more, you can go to this website,
    http://www.downloadatoz.net/download/adobe-reader-for-mac/
    http://www.downloadatoz.net/download/adobe-reader-for-mac/using-the-adobe-reader -plugin-with-firefox-on-mac_g.html

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • Can't open pdfs with Adobe Acrobat X

    I can't open pdfs with Adobe Acrobat X. I get this message:
      Warning: Distiller will not process .Log, .PDF or .JDF file extensions
    What do I need to do to be able to open .pdf files? I could open them previously.

    What are you getting the message in response to? Was this a creation of a PDF that resulted in the message? What are you using Distiller for? Distiller can only open PS and EPS files for processing to create a PDF.
    PDF files are opened in Acrobat. For opening PDFs, Distiller has nothing to do with the opening. So I really have no idea. It sounds like you may just be having a creation error since you mentioned a log file. If you were creating a PDF, have you checked the LOG file for the errors? The log file is usually located where you were going to create the PDF, but is created as Distiller processes the file (part of the general Acrobat creation process) and is deleted if successful.
    If you were trying to create, go back to the original application and print to file with the Adobe PDF printer. Then open that file in Distiller to create a PDF. Any errors will be shown in the window and an indication if the PDF was created or not.

  • My app tabs fail to open when i reopen the browser. why?

    After installing 4.0 yesterday I started experimenting with new features, including the app tabs. I closed some of the app tabs, though not all, and then as an experiment closed & reopened the browser.
    Your specs say that:
    All of the App Tabs you have set when you close Firefox will open as App Tabs when you start Firefox again.
    This did happen for me. Neither the app tabs I had open when I closed the browser nor the ones I had closed were saved. It seems that maybe this feature is not behaving as expected? There appears to be no persistence with the app tabs.

    Your System Details List shows the NoSquint extension, so you can check the zoom settings in that extension.

Maybe you are looking for

  • Macbook pro late 2012

    I own Macbook pro late 2012. I noticed fried chip near fan it has six connector, three on each side. Does anyone have clear photo of this side of the motherboard?

  • What does Acrobat 9 pro have over Acrobat 7 pro?

    Does anyone know where I can find what features are available in Acrobat 9 pro that aren't in Acrobat 7 pro?    Or know off hand what the differences are.  I can't find a comparison anywhere.

  • Making Lower 3RDs in Photoshop

    I've read about the differences with how Photoshop and FCP calculate Pixel Aspect Ratio. 1. Should I just keep the PAR in PS as the default of Square Pixels, and deal with it in FCP? 2. Should I avoid using any of the blank templates for video that P

  • IPhone 1.1.4 VPN to Leopard 10.5.3

    Has anyone seen and preferably solved the problem of a working VPN for all but iPhone, and an iPhone that completes authorization and then almost instantly disconnects? The "error" in the server log seems to indicate that the "serial link" is or beco

  • How to enable cross origin support in SharePoint

    Could someone please help me to enable cross origin (CORS) support on SharePoint 2010. I am following steps mentioned in http://www.avanadeblog.com/sharepointasg/2013/01/cors-request-to-sharepoint-with-basic-authentication.html and http://evolpin.wor