Problem viewing PDF File in JSP

Hi,
I have the file location of a PDF saved in the database.
If I modify the PDF file on my directory and then try to view it in my browser, it still shows the old file .. (I do not modify the pdf file name)
However, when I close my browser and reopen it, it shows up okay. this looks like a browser level problem but can someone give me an idea on how I can solve this problem within my JSP...
Here is some code to view the file
<a href="<%= response.encodeURL(fileLocation) %>"><%= binderName + ".pdf" %></a>
Thanks,
Yasir

The problem you are having is a browser cache issue. If you open the same URL, the browser is trying to save you time by giving you what it got last time. The trick is to make the URL different each time it is opened. Just append a hash or some other unique code:
Instead of:
http://myserver/pdfMakerServlet/newpdf.pdf
Use this:
http://myserver/pdfMakerServlet/newpdf.pdf&012345
If the URL is different each time, the browser will ask the server again for the file.
Does this help?

Similar Messages

  • Acrobat X pro - Problem viewing PDF files in web browser

    I've recently upgraded to the latest Imac and have experianced one or two teething problems with software compatibility with OS X 10.7.1 Lion (most now resolved)
    My latest issue is viewing online PDF's which appear in my browser as just a blank black page. This happens in both Safari and Firefox (both latest versions)
    My question is: Does anyone have any ideas on how to solve this?

    I was able install and view the files in adobe reader 10.1.1 and in web browser window 7 64 bit machine.  But when I go to Edit-preferences-internet and  unchecking "display PDF in Browser" , I am not able to view the pdf files in ie 9 browser.  I have used this javscript to check for pdf version.
    Immediately after installing adobe--
    when I do adobe test in ie 9---https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html--  launches a test pdf file--Acro_Test.pdf
    After unchecking-- it stays in the  https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html instead of showing test pdf file--Acro_Test.pdf
    Tried to go back to "display PDF in Browser"--it is showing it is checked(eventhough I did not check it)
    and in ie
    it stays in the https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html instead of showing test pdf file--Acro_Test.pdf

  • Problems viewing PDF files following Acrobat Pro XI update to 11.0.10

    Following update to Acrobat Pro XI version 11.0.10, some of my PDF files give me the message "cannot find or create the font 'Times-Bold'. Some characters may not display or print correctly" when I try to open them. Associated with this is that the characters "fl" are missing, i.e. the word "fluid" in the files appears as "uid". For some other files, I do not get the message "Cannot find or create..." but "fl" is missing nevertheless. I had no problems prior to the 11.0.10 update. I have tried a repair installation to no avail. Any help would be greatly appreciated.

    Hey serafimk98854984 ,
    First thing first, Are you facing this issue with all pdf files or just one particular file? Because if you are facing this error with that particular pdf file then it might be because the fonts in the pdf file might have got corrupt.
    secondly i would like to know that which operating system are you using?
    Moreover, if you have acrobat installed on your system, then you might try the following procedures :
    1. Go to File-> save as other -> more options ->Post script ;
    Now open Adobe Distiller and convert Post script file into Pdf file.
    If the above procedure doesn't work then try the following :
    2. Tools - > Print Production -> Preflight -> PDF fixups -> 'Embed Fonts' and 'Embed Fonts (even if text is invisible)' -> Analyse and Fix
    Let me know if any of this works for you!!
    Regards,
    Rahul

  • Problem viewing pdf files when browsing

    Help!  Ever since downloading the lates Adobe and purchasing it, I can't view a pdf file at all from any site without first saving it somewhere.  If I just click on it, it won't open -- it makes me save it to a file first.  That never happened before.  After I download it and save it, then I can view it.  Is there a setting I need to change or something?  Thanks...

    Hi Randy,
    Try this:
    - Quit Safari completely (Safari menu > Quit)
    - Launch the Terminal application (Applications > Utilities > Terminal)
    - Enter the following command and then press return:
    defaults write com.apple.Safari WebKitOmitPDFSupport -bool NO
    - Close the Terminal window
    - Restart Safari
    - Try another PDF file and see if they now open in Safari.

  • Problem viewing pdf files

    When I click on a pdf file, it is black.

    i have these kind of problems too:
    it only appears in os x preview, safari, quicklook, and apps like papers, who uses the "os-x-pdf-engine". but these pdfs will only shown correct with the acrobat-reader. the problems are: complete black, complete empty, some objects are invisible, pictures are invertet, ect. a developer told me, that it is a bug in os-x...

  • How to view pdf file in java/jsp?

    Hello Everybody,
    Any one help me how to view pdf file in jsp using java application.
    I have pdf file c:\app.pdf.
    How can i display the pdf file.
    Please help me.................
    Thanks

    Hello,
    You can use the below code, but i am not sure how far is this a startard way of doing it.
    # <%
    # ServletOutputStream servletOutputStream = response.getOutputStream();
    # File reportFile = new File("C:\\Tomcat 5.0\\webapps\\TestApp\\myfile.pdf");
    # FileInputStream fis = new FileInputStream(reportFile);
    # byte[] bytes= new byte[128000];
    # int count=fis.read(bytes);
    # try
    # response.setContentType("application/pdf");
    # response.setContentLength(bytes.length);
    # servletOutputStream.write(bytes, 0, bytes.length);
    # servletOutputStream.flush();
    # servletOutputStream.close();
    # }catch(Exception e){}

  • Since I have Yosemite on my iMac I can't view PDF files in Safari anymore.  It keeps telling me to upgrade my Adobe Reader, but it is the latest version.  Please help?  I don't have this problem on my Macbook that does not have Yosemite installed.

    Since I have Yosemite on my iMac I can't view PDF files in Safari anymore.  It keeps telling me to upgrade my Adobe Reader, but it is the latest version.  Please help?  I don't have this problem on my Macbook that does not have Yosemite installed.

    Back up all data before making any changes. Please take each of the following steps until the problem is resolved.
    Step 1
    If Adobe Reader or Acrobat is installed, and the problem is just that you can't print or save PDF's displayed in Safari, you may be able to do so by moving the cursor to the the bottom edge of the page, somewhere near the middle. A black toolbar should appear under the cursor. Click the printer or disk icon.
    Step 2
    There should be a setting in its preferences of the Adobe application such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected.
    Step 3
    If you get a message such as ""Adobe Reader blocked for this website," then from the Safari menu bar, select
              Safari ▹ Preferences... ▹ Security
    and check the box marked
              Allow Plug-ins
    Then click
              Manage Website Settings...
    and make any required changes to the security settings for the Adobe PDF plugin.
    Step 4
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard by pressing the key combination command-C:
    /Library/Internet Plug-ins
    In the Finder, select
              Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens by pressing command-V, then press return.
    From the folder that opens, move to the Trash any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari.
    Step 5
    The "Silverlight" web plugin distributed by Microsoft can interfere with PDF display in Safari, so you may need to remove it, if it's present. The same goes for a plugin called "iGetter," and perhaps others—I don't have a complete list. Don't remove Silverlight if you use the "Netflix" video-streaming service.
    Step 6
    Do as in Step 4 with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari.

  • The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser. Please exit Adobe Acrobat/Reader and exit your Web Browser and try again.OK. I followed the instruction and the problem still persists.

    I got the following pop-up when I tried to open an online PDF file:
    The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.
    Please exit Adobe Acrobat/Reader and exit your Web Browser and try again.
    I tried many time, and it really doesn't work.
    The plug-in I have is Adobe Acrobat 8.3.0.280

    After I upgraded to Firefox 5, I had the same problem and I did a work around temporarily. I went the tools menu, then Add-ons, then clicked the "Plugins" on the left side (4th one down). I "disabled" both Adobe Acrobat 8.3.0.280 and Adobe Acrobat 10.1.0.536 using the disable buttons on the right side. PDF files now open again. However they are outside the actual browser.
    My guess is that Adobe didn't catch up yet with a new update to work with Firefox or vice versa.
    Hope that helps!
    Michael

  • Since I downloaded version 4 of Firefox, I'm having the following problems: Extremely slow at loading all web sites, can't view PDF files from web sites, and lots of unresponsive script messages. How can I fix this?

    I downloaded version 4 of Firefox this week and have been having problems since. Firefox is now extremely slow at loading all web sites. Trying to view PDF files from web sites crashes Firefox. I'm getting lots of unresponsive script messages. How can I fix this?

    I downloaded version 4 of Firefox this week and have been having problems since. Firefox is now extremely slow at loading all web sites. Trying to view PDF files from web sites crashes Firefox. I'm getting lots of unresponsive script messages. How can I fix this?

  • Im having problems with my safari Web browser  to opening/viewing pdf files.

    Im having problems with my safari Web browser to opening/viewing pdf files. I installed the 8.1.2 version But then when I click to open any PDF it says that Adobe PDF Viewer cannot find a compatible Adobe Acrobat or Adobe Reader to view this PDF. Please select one.
    i can see the adobe reader but can not select it .

    did you find a solution to this? my safari history is full of
    explicit sites that i have not visited. i see a lot of info on how to remove it, but none on how to figure out how they got there.

  • Acrobat plug-in. I get this when try to opem. The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser. Please exit Adobe Acrobat/Reader and exit your Web Browser and try again. Don't problems w/ Internet Explorer-

    Acrobat plug-in.
    The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.
    Please exit Adobe Acrobat/Reader and exit your Web Browser and try again.

    See if you can find a NPPDF32.DLL files in the Firefox program folder (C:\Program Files\Mozilla Firefox\)
    You can see the installed plugins on the about:plugins page.
    * http://kb.mozillazine.org/about%3Aplugins
    You can set the pref plugin.expose_full_path to true on the about:config page to see the full path of plugins on the about:plugins page.
    It is best not to leave that pref set to true as it exposes that full path to web servers, so reset that pref to false after you are done with the about:plugins page.
    You can open about:plugins and about:config via the location bar, like you open a website (about: is a special protocol to access some build-in pages).
    If you get a warning when opening the about:config page then you can confirm that you want to continue.
    See Manually uninstalling a plugin:
    * https://support.mozilla.com/kb/Troubleshooting+plugins

  • AdobeAcrobat/Reader that is running can not be used to view PDF Files in Web Browser...what do I need to do to fix this..

    I just got Windows 7 and have been having problems since loading it. Most of my drivers only go to Vista and don't recognize 7.
    I have trying to download some manuals from their website
    and keep getting this message; Adobe Acrobat/reader that is running can not be used to view PDF files in Web Browser.

    Could I suggest a workaround for PDFs until a solution is posted? Open them directly in the Adobe application rather than in a browser tab.
    In your Adobe application(s), go to:
    Edit > Preferences > Internet
    Then uncheck "Display PDF in browser"
    (There are very few sites where having PDF integrated is really beneficial.)

  • Chrome - Adobe-Acrobat/Reader can not be used to view PDF files in a web browser.

    I can't view PDF files via Chrome (it works on Internet Explorer but I prefer Chrome)  -  the error below has arisen recently on Chrome, though I can't see what has changed.
    "Acrobat plug-in
    The Adobe-Acrobat/Reader that is running can not be used to view PDF files in a web browser. Please exit  Adobe Acrobat/Reader and exit your Web Browser and try again."
    I have looked through Forum articles on similar errors and have tried the following(text copied from other Forum entries)
    Repair Adobe Acrobat (from Acrobat)
    Repair Adobe Acrobat (from Control Panel
    Configure Acrobat  as a helper application: Choose Edit > Preferences., Select Internet on the left., Deselect Display PDF In Browser Using [Acrobat application], and then click OK.Quit Acrobat or Reader
    Create a registry item for Acrobat: with Regedit: If the registry item doesn't exist on the system, do the following: Go to Edit > New > Key and create the missing HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe.Go to Edit > New > String Value and name this key (Default).Select (Default), and then go to Edit > Modify. Type the Adobe Acrobat path in the "Value data" for your product.,restart your computer
    Repair the HKCR\AcroExch.Document registry key: Navigate to HKEY_CLASSES_ROOT\AcroExch.Document., Right-click AcroExch.Document and select Delete; make sure that you have the correct key, and click Yes on any prompts, Right-click AcroExch.Document.7 and select Delete; make sure that you have the correct key, and click Yes on any prompts. Repair your Acrobat  installation
    None has solved the problem. However it still works ok with IE. But I want to stick with Chrome because I find IE is so slow!
    I am using Vista, with Adobe Acrobat standard 9.5.2 and Google Chrome version 23.0.1271.64 m which is marked on Chrome as 'up to date'
    Does anyone know why I might be getting this error on Chrome but not IE?

    I think I have discovered the answer to my own question!
    I have disabled Adobe Reader plug-in, and can now see PDFs in Chrome.
    (Steps: Chrome Menu, Settings option, Click Advanced Settings link, then Content Settings button, then select Disable Individual Plug-Ins, and a list of plug-ins is offered to enable or disable).
    I then get a different result depending on whether or not Chrome PDF viewer is enabled - with it enabled I see the PDF document in Chrome, or with it disabled then the option is offered to download it, but either way I can get it it via Chrome without having to run Internet explorer in another browser window.

  • Adobe 9.1.3 and FireFox 3.5.1+ "...can not be used to view PDF files in a Web Browser"

    This is the issue but I'm not sure there is a resolution:
    Firefox:  Version 3.5.1
    Adobe: Version 9.1.3
    When navigating the web, click a URL that opens a PDF inside the browser and you get an error * "The Adobe Acrobat/Reader that is
    running can not be used to view PDF files in a Web Browser".  Please exit Adobe Acrobat/Reader and exit your Web Browser and try again".  I did read a post that doing a "repair" from the Adobe Reader application should fix this, they also reference a few registry keys to check becuase the post states it's lost the application path to Adobe version X.  I don't necessarily buy that "fix" and here are my details below.
    In FireFox if you navigate to Tools > Options > Applications > Adobe Acrobat Document
    You're given choices:
    Always ask:  DOES NOT WORK, produces afore mentioned error *
    Save File:  Works, saves the file to a directory on your PC
    Use Adobe Reader 9.1 (defau...:  Works, opens your PDF's outside of your web browser
    Use Adobe Acrobat (in Firefox):  DOES NOT WORK, produces afore mentioned error *
    Use other...:
    IE seems to just work as expected.
    If you open Adobe Reader > Edit > Preferences > Internet > Check "Display PDF in browser" - DOES NOT WORK, produces afore mentioned error *
    This would seem to be an Adobe error rather than a FireFox web browser problems since FireFox does seem to know the correct path although I suppose you can't rule out that this is a FireFox problem since 2 out of the 4 PDF open options DON'T WORK.
    Any thoughts on this issue would be greatly appreciated.
    Other information:
    Adobe 8.1.5 works perfectly with FF 3.5.1+ when opening PDF's in the web browser, we also had no problems with previous versions either.
    MSI push via Active Directory from Adobe 8.1.5 upgrade to Licensed Distribution I signed up for, Adobe 9.1.3 which was upgraded from 9.1.0, to 9.1.2, to 9.1.3 via an MSP patch.
    Operating system:  Windows XP SP 2, plenty of RAM, plenty of Drive
    IE version this works with the new version of Adobe 9.1.3 is version 7 (7.0.5730.13)
    Our FireFox MSI's come from Front Motions website and as far as I know we've never had problems with their MSI's, also tried the new release of FF 3.5.2 from their website.
    I think that about covers it.  Anyone else experiencing the same problems or have a patch?

    After troublshooting this for the entire day today the issue seems to be a MIME problem.
    If everything is woking perfectly, in Tools > Options > Applications...
    You should see 4 or more things related to Adobe like "Adobe Acrobat Forms Document", etc.  If you don't see at least 4 MIME entries either your Adobe installation is hosed or your FF installation is hosed.  I haven't figured out which is causing the issue.
    What I did was remaster my patches from my original Adobe 9.1.0 MSI with the two updates via the command line in the directories with the source files.  On the 9.1.0 original file I first remastered my MST transform with the Adobe MST utility.  I then applied my patches.
    msiexec /a AcroRead.msi /p AdbeRdrUpd912_all_incr.msp
    msiexec /a AcroRead.msi /p AdbeRdrUpd913_all_incr.msp
    I then uploaded that to my network share, unlinked my group policy, made a new group policy, added a batch file to delete adobe.com from program file and the desktop on system startup even though my MST was supposed to take care of that - it's not a perfect world is it?  :-)
    I then reapplied my GPO's for both FireFox 3.5.2 and Adobe 9.1.3, I checked to make sure the MIME extensions were there and they were.  You might have to go into your Adobe Preferences and select that open in browser setting depending on what happens or adjust your MIME settings in FireFox's options but it should work.
    That's what worked for me.  It's possible a few other things I did along the way tweaked it out, in my group policy on the first run I did select to upgrade previous group policies, for the remaster and repush I didn't select any previous GPO's to upgrade.
    It's hard to tell what one thing tweaked it out or what combination of things tweaked out the install.  I did also reinstall Adobe 8.1.5 and FF 3.0.10 before doing all this since our machines currently have that setup, I'm not sure if that affected it either, it's just hard to tell but I don't think it did simply because I had done that several times in troubleshooting this issue.
    If anyone else has more specifics that would be great!

  • How can I quickly view pdf files like I can do with Windows Picture and Fax viewer for jpg files?

    How can I quickly view pdf files like I can do with Windows Picture and Fax viewer for jpg files? I need to look at several thousand PDF files. It takes too long to open each one individually. The only thing I could think of is combining them into large groups and then using the Navigation index. But I like the way windows Picture and Fax Viewer does it because you can keep the files separate. Combining PDFs causes loss of individual file names. That would be a problem since I do need to have the individual file names.

    Windows Picture and Fax Viewer is a DLL and is started via a rundll32.exe call and can't be set as an application to handle images in Firefox 3 and later versions.
    Try to set Windows Picture and Fax Viewer as the default viewer in Windows, then it should be listed automatically in the Mozilla Firefox Browse dialog.
    *http://www.winhelponline.com/articles/115/1/Windows-Picture-and-Fax-Viewer-as-the-default-viewer-in-Mozilla-Firefox.html
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

Maybe you are looking for