Unable to View PDF in Browser from a Servlet.

Hi,
I am facing a problem while trying to dynamically generate PDF from a Servlet and display it in the browser(IE 6.0 sp2)
The scenario is as follows:
i have a link which on clicking (using javascript) moves to a Servlet(say Dispatcher Servlet).This servlet forwards the control to another Servlet(say PDF Renderer Servlet) which generates the PDF and tries to display the results to the browser.
The PDF does get generated.
However in the pop-up i get a alert message to either open or save the PDF.But when i try to do so the message i get is that IE failed to communicate with the server.
The code i am using to display the PDF is as follows
ByteArrayOutputStream outfile = pdfTransformer.transform(xmlString,container);
byte[] content = outfile.toByteArray();
response.setContentType("application/pdf");
response.setContentLength(content.length);
response.setHeader("Content-Disposition", "inline; filename=\"" + pdfName + "\"");
ServletOutputStream out= response.getOutputStream();
out.write(content);
out.flush();
out.close();
Any suggestions would be a great help.
Thanks

Hi,
I have the same code as Viv above and I am generating pdf using fdf file format. the code works upto the point where it generates pdf. I am not setting the header to open the file in the same browser or new window:
(not in my code)
response.setHeader("Content-Disposition", "inline; filename=\"" + pdfName + "\"");it was working fine last week and now it starts to give a pop up box with only one option of saving the pdf file, there is no option to open it. when I save it the data in the file is lost, its just a fblank form. I am using IE 6.0.2900
any suggestions?
Ali

Similar Messages

  • Unable to view pdf files sourced from websites

    Hi
    I have previously had no trouble viewing pdf files from various websites, however am now unable to.  It appears to be loading and then just comes up with a blank screen.
    I am able to view pdf files which have been emailed without problem.
    I have removed Acrobat Reader & reloaded but this has not helped.
    I am able to view pdfs on our laptop & ipad and the settings appear to be the same.
    Does anyone know what I can do to resolve this problem?
    Thanks!

    For Safari, you need to remove the adobe pdf plugins which Adobe apparently screwed up.  You need to remove:
    /Library/Internet Plug-Ins/AdobePDFViewer.plugin
    /Library/Internet Plug-Ins/AdobePDFViewerNPAPI.plugin
    I think you can "get away with" removing just the second one.  But both for sure should allow you to open pdf's in a browser (all browsers).
    If you are not using Safari the above will work for other browsers too, although in FireFox, you could just disable the use of those plugins from within Firefox (Tools menu --> AddOns --> Plugins).

  • Unable to view pdf documents opened from a website

    I'm not able to view pdf documents, e.g. bank statements or tax returns, when opened from a website. If the site offers the option to download, I can do that and have no problem opening the downloaded file and viewing in pdf. The problem is when the pdf file opens in another window, or in a window within a window - then I just get a black screen where the pdf document should be. Has anyone encountered this and fixed it? I've already followed any help I can find online, like making sure pop-up blocker is turned off, and that java, java script are enabled, and downloading most recent adobe acrobat. So far, nothing has worked.

    To Apple Discussions!
    Check your browser(s) preferences to see if you have PDF files properly mapped.
    *For FireFox v3.0:*
    FF>Preferences>Applications
    I have Always Ask to open word/text documents.
    Preview is the app I use to view PDF documents.
    *Another suggesion:*
    Strongly recommend that you update your OS to the latest Tiger version - 10.4.11. Your system info confirms you are still using the basic OS 10.4.

  • Unable to view PDFs from the Safari browser.

    I am using Safari 5.1 and Adobe Reader 10.1.0, running on OS 10.6.8.  Until recently I had no problem but am now unable to view PDFs from websites.  What I get is a totally black document.  I can create PDF files which I can also open outside of the internet.  Any ideas?? 

    There seems to be an issue with Adobes plugin and Safari 5, your options are:
    Wait for it to be updated.
    Uninstall the plugin nd let Quicktime handle it.
    Install Schuberts PDF plugin from http://www.schubert-it.com/pluginpdf/

  • Unable to view pdf created in Live Cycle Designer ES2-initially thought to be a user/OS issue

    Unable to view pdf created in Live Cycle Designer ES2.  I initially thought this was a user / OS issue when I created a document for someone who is new to a MAC laptop.  She could not view the document through email.  Unfortunately, I began seeing the same error in my own document folders when searching for another document showing as icons instead of a list.  I can open the file without a problem although I see the error she sees only while viewing the icons in my folder.  I am using a Windows 7 PC. Now, I also know that if the document is downloaded, it can be viewed.
    Other notes:
    If trying to access the form via the internet, the same error is seen through Chrome, Firefox, and Mozilla but NOT through IE
    Everyone seems to have the latest or a very recent READER
    The form is compatible with Reader versions 7 and up
    Again, downloading from the internet to the computer appears to allow the file to open properly
    Document cannot be viewed on the Galaxy Tab 2 via Chrome or the pre-installed Internet Browser, nor can it be viewed through the Reader after download to tablet. I did not try on an Apple iPad.
    All parties involved are up-to-date with virus protection.
    Below is a link to the exact message received when trying to open the document.
    https://www.dropbox.com/s/wmjqzwyriovg9vi/Adobe%20Error.pdf

    You're on to something KJ!  Yes the form was created in LiveCycle Designer ES2 which came bundled with my Adobe X Pro.  I began creating a new form yesterday and found that I could not preview the form, rendering this same "error" instead.  I ran a repair on my Adobe and at first it seemed to fix the issue but after making some changes to the form I tried to preview again and couldn't.  Here is what I get when I try to preview my forms in Designer ES2: 
    When I click the OK button, it then gives me that single static page as mentioned above in previous posts.
    I searched Adobe yesterday trying to figure out how I could repair the LiveCycle Designer or if there was some sort of patch that I haven't gotten but was not able to find anything.
    (Sorry for the delay in response, I've been on vacation.)
    Message was edited by: AngelaC

  • Unable to view PDF files in Infoview

    I am unable to view pdf files in InfoView (Business Objects Edge Series XI 3.0)
    When I select the pdf file from Infoview, I receive the message 'Do you want to save this file' which only allows me to save the document to a location on my computer.
    Other users can view the file in Infoview, so it probably relates to a setting on my computer.
    Any ideas?
    Thanks

    I've had a little look on Adobe's knowledge base; try this to check whether the issue is related with opening PDF in your browser in general:
    "Determine if the web browser can open the PDF file from your local hard drive rather than from the web:
    In the web browser, choose File > Open (or Open File).
    Choose All Files from the Files Of Type pop-up menu (Windows)
    Click Browse
    Select the PDF file you saved in step 1 of task 5, and then click Open to open the PDF file. If Acrobat or Adobe Reader displays the file, but won't display it on the web, the web server has a problem serving the PDF file. Contact the webmaster of the site from which you downloaded the PDF file."
    If so, try the troubleshooting steps mentioned here:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=328233&sliceId=2

  • Unable to view pdf - initially thought to be user / OS issue for new user to MAC.

    Unable to view pdf created in Live Cycle Designer ES2.  I initially thought this was a user / OS issue when I created a document for someone who is new to a MAC laptop.  She could not view the document through email.  Unfortunately, I began seeing the same error in my own document folders when searching for another document showing as icons instead of a list.  I can open the file without a problem although I see the error she sees only while viewing the icons in my folder.  I am using a Windows 7 PC. Now, I also know that if the document is downloaded, it can be viewed. 
    Other notes: 
    If trying to access the form via the internet, the same error is seen through Chrome, Firefox, and Mozilla but NOT through IE
    Everyone seems to have the latest or a very recent READER
    The form is compatible with Reader versions 7 and up
    Again, downloading from the internet to the computer appears to allow the file to open properly
    Document cannot be viewed on the Galaxy Tab 2 via Chrome or the pre-installed Internet Browser, nor can it be viewed through the Reader after download to tablet. I did not try on an Apple iPad.
    All parties involved are up-to-date with virus protection.
    Below is a link to the exact message received when trying to open the document.
    https://www.dropbox.com/s/wmjqzwyriovg9vi/Adobe%20Error.pdf

    Sorry, this is a user to user forum and we're just customers who help out when we can, so things don't always happen right away.
    Reader, Regardless of OS or device, is as the name implies, only a Reader.  There are different mail settings between Mac Mail Outlook and Thunderbird as well as Andsroid's mail app, whose name escpoaes me.
    Have you checked in the Live Cycle Forum? There are people there with FAR more experience using LC developed forms. It's part of my Creative Suite, but I've never even opened it myself.

  • Unable to view PDF files online (This message appears see screenshot)

    Unable to view PDF files online (This message appears > see screenshot)

    It says:
    '' Before viewing PDF documents in this browser you must lunch Adobe Reader and assept the End User License Agreement, then Quit and relaunch the Browser ''
    Though, i can oped normally PDF files like Fotos, Invoices etc.
    Any idea what's going wrong ?
    Thanks for your time.
    Kind Regards,
    Alex

  • Unable to view pdf in Adobe Reader

    I am unable to view pdf in Adobe Reader. I have uninstalled and reinstalled, carried out the adjustments in prefernces and the internet as advised in the help section in Adobe Reader. I am at aloss as to overcome this problem. Any adise would be appreciated. Thanks
    Ausy58

    The pdf file does not show in any window, I have tried on different sites on the internet with the same effect.
    Message from Bernd Alheit <[email protected]> at 2011-11-18 05:09:26

  • Unable to view pdf in safari

    hello anybody can help- unable to view PDF files from the web

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (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 (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat 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 again.

  • I am using safari 6.0.3 I am unable to view PDF files online - I reset safari - did nothing - any ideas? thank you

    I am using safari 6.0.3 I am unable to view PDF files online - I reset safari - did nothing - any ideas? thank you

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (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 (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat 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 again.

  • Unable to view pdf files in IE 11.

    Unable to view PDF files in IE 11, Winows 7. Works fine in Google Chrome on same pc. Everything is up todate.

    See the solution at http://support.microsoft.com/kb/2716529
    However, that Fix-it won't work on Windows 7; you will need to make the registry change manually.  Download, unzip, then run the attached registry script to change that registry value.

  • Problem with LTKRN11N.dll after enabling "View PDF in Browser" option

    Good afternoon,
    I'm trying to install an internal business application on one of our office PC's but keep getting errors during the install.  The two errors I receive are:
    The ordinal 267 could not be located in the dynamic link library LTKRN11n.dll
    The ordinal 173 could not be located in the dynamic link library LTDIS11n.dll
    I've narrowed the problem down and can repeat it...it seems to be the result of enabling the option "View PDF in Browser" in the preferences of Adobe Reader 9.3.  Simply unchecking the option does not fix the problem and neither does uninstalling Adobe or the other application.  So far, the only answer has been to re-image the machine without the option, install the other application and then enable the option (if needed) however, once the option has been enabled, any further attempts to install the application, will fail, reuquiring a re-image.
    Any help with how Adobe uses these dlls or what might remedy the problem would be greatly appreciated.
    Thanks,
    Matt

    It looks like the 2 DLLs you mentioned, are getting corrupted or modified due to some operation that might have been performed on them. Can you please try the below mentioned instructions and see if that gets your application to install without any errors:
    1. Try installing your business app.
    2. When you see the error message as stated, try running the below mentioned commands: (Start | Run | Type cmd and hit Enter)
        regsvr32 LTKRN11n.dll /i /s
        regsvr32 LTKRN11n.dll /s
        regsvr32 LTDIS11n.dll /i /s
        regsvr32 LTDIS11n.dll /s
    3. The above commands should fix the issues in the mentioned DLLs and allow normal installation of your business app.
    Hope this gets your app to work and install properly.

  • Unable to view PDF (baggage file) in CHM

    Hi,
    I have recently started using a new desktop pc running Windows 7. I am now unable to view PDF files (added as baggage files in RoboHelp) in the CHMs generated by RoboHelp. Even existing CHMs (generated before switching desktops) have this problem. Has anyone experienced the same problem and managed to solve it?
    Sofie

    A while back someone told me they had a similar problem with IE8 and advised they fixed as below:
    "After fiddling around with some settings, I found that if you go to Settings/Safety and enable Active X Filtering, the embedded files open normally."
    That will only fix it on your machine though. Do these CHMs work on other machines OK?
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Updating to 7.10 disabled viewing pdf in browser

    updating to 7.10 disabled viewing pdf in web browser which is working normally in 7.09 no matter settings in preference, internet, are all marked to view pdf in browser and allow fast web view etc, every pdf links are opened in a new acrobat window which is something I DON'T WANT.
    how is it possible to return it to a normal state to view pdf in browser ?

    <[email protected]> wrote in message <br />news:[email protected]..<br />> ...<br />> Is it possible to do this? (i.e configure the reader only to show<br />> the content without toolbar/option bar)?<br />> ...<br /><br />Since you are producing the PDF, take a look at the ViewerPreferences <br />dictionary in the PDF Reference Manual; for PDF 1.4 it's section 8.1.<br /><br />> ...<br />> Now, I'd like to prevent the users to be able to save the<br />> displayed PDF, because they should be allowed only to read them.<br />> ...<br /><br />However (a) that's only a preference, the viewer may honor it or not, (b) F8 <br />is still there to put the bar back, and last but not least (c) it won't <br />prevent making a copy of the file, but I'm sure it will irritate a lot of <br />your clients (lack of navigation/ zoom/ etc buttons, for one thing).

Maybe you are looking for

  • Format of Functional Specification

    What is the format of Functional Specification.

  • How to set limit on sum of totals of all sales orders of a business partner in SAP B1

    Hi, I would like to set a limit on a business partner so that the sum of totals of all orders placed for that business partner do not exceed a certain amount. How can I do that? Regards, Victor

  • Geforce 7800 gtx card in my mac ?

    Hi, to troubleshoot a display problem with my MacG5, ( http://discussions.apple.com/thread.jspa?threadID=1121100&tstart=0 ) I would like to install a second graphic card in it. I have a PC Nvidia Geforce 7800 gtx card. Can I install this without any

  • Settings that may prohibit word wrap.

    Are there any settings in InDesign preferences or anywhere else that might prohibit word wrap from working in a document.  The word wrap functions in a design file I'm working on are not working, but when I do the same steps in a new blank document i

  • Saving a CS4 InDesign file in CS5 gives me an error

    I have an InDesign file that I originally created in CS4, but when I opened in CS5, I get an error saying: "Cannot save 'Filename.indd' under a new name" I tried to export to IDML as suggested in the forums, but I get an error message stating: "Disk