Forms11g display pdf in a browser

Hi, I have a PDF document saved in a table as BLOB, how to display it in a browser using forms11g?

Hi,
Try this
create or replace
procedure getpdf (p_id number) as
      l_lob    blob;
     l_amt    number default 30;
     l_off   number default 1;
     l_raw   raw(4096);
begin
     select theBlob into l_lob
         from demo
          where id = p_id;
     owa_util.mime_header( 'application/pdf' );
            loop
               dbms_lob.read( l_lob, l_amt, l_off, l_raw );
               htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
               l_off := l_off+l_amt;
               l_amt := 4096;
            end loop;
         exception
            when no_data_found then
               NULL;
         end;Invoke this procedure through browser like this
http://localhost/pls/sagi/image_get.getpdf?p_id=1
here sagi -- Name of the configured DAD (change with your DAD's name)
image_get -- package name
getpdf -- procedure name.
p_id -- parameter
Hope this helps

Similar Messages

  • Display PDF on the browser from BLOB column

    Hi All,
    I have BLOB column in the table where we are storing PDFs.
    I want to display PDF within the browser ( not as a download option) from that BLOB column, like clicking on the "Print" link.
    Please let me know if anyone has any suggestion.
    -Smith

    Create this DB procedure:
    procedure show_webdoc(io_blob    in out nocopy blob
                         ,i_mimetype in varchar2
                         ,i_filename in varchar2)
    is
    begin
       if dbms_lob.getlength(io_blob) >0 then
          owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
          htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
          htp.p('Content-Disposition:  inline; filename="'||i_filename|| '"');
          owa_util.http_header_close;
          wpg_docload.download_file(io_blob);
       end if;
    end;Get the blob and give it as input to this procedure. For a pdf the mime type will be application/pdf.

  • Use byte array of PDF to display PDF in IE browser

    I get byte array of PDF as input argument. I need to use byte array to display PDF in IE browser. I am writing code in doGet method of Servlet to accomplish this. However, PDF never gets displayed. I see Acrobat starting, but original PDF never gets displayed in browser.
    I am using code below in doGet of Servlet:
    resp.setContentType("application/pdf");
    resp.setHeader("Expires", "0");
    resp.setHeader("Cache-Control","must-revalidate, post-check=0,
    pre-check=0");
    resp.setHeader("Pragma", "public");
    resp.setHeader("Pragma", "no-cache"); //HTTP 1.0
    resp.setDateHeader("Expires", 0); //prevents caching at the proxy
    server
    resp.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
    resp.setHeader("Cache-Control", "max-age=0");
    resp.setHeader("Content-disposition", "inline; filename=stuff.pdf");
    byte[] inBytes = getBytesOfPDF(...);
    ByteArrayOutputStream outStream = new ByteArrayOutputStream();
    if(inBytes !=null){
    outStream.write(inBytes);
    outStream.flush();
    I added dummy name of PDF (stuff.pdf) for display, as I heard IE requires a file name with .pdf extension for display.
    But I had no luck with the code above.
    Any help with code will be appreciated.
    [email protected]

    Hi
    Am using the same code and i am able to get the PDF out.
              /* Finally writing it into a PDF */
                   response.setContentType("application/pdf");
                   /* filename could be any thing */
                   response.setHeader("Content-Disposition",
                             "attachment; filename=Report.pdf");
                   response.setContentLength(content.length);
                   response.getOutputStream().write(content);
                   response.getOutputStream().flush();
    But this also throws a error in the server :
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
         at org.apache.catalina.connector.Response.getWriter(Response.java:606)
         at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
         at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:344)
         at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:280)
         at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:225)
         at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:174)
         at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:239)
         at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1142)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:879)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.ca.ielts.presentationtier.servlet.AuthorisationAuthenticationFilter.doFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    Any Clues how this has to be fixed.????

  • I have set the CustWiz/MST to 'Disable and Lock' the ability to display PDFs in the browser.  We wan

    I have set the CustWiz/MST to  'Disable and Lock' the ability to display PDFs in the browser.  We want  them to open separately in Acrobat.  After I deploy, the setting IS  disabled and locked, but when you click a PDF in the browser, it STILL  opens in the browser, and not in Acrobat.
    I am pushing  Acrobat onto machines that already have Acrobat Standard 9 installed  with the same settings.  It worked properly then.
    What is causing this setting to be ignored?  How can I fix it?  It's delaying my deployment.
    I have to deploy Acrobat 9 due to the bug I discovered here:
    http://forums.adobe.com/thread/865843
    (With many other frustrating responses).
    This is getting a little irritating...
    Thanks for any input!
    Acrobat Standard X
    XP SP3
    Firefox 5

    Thank you for the answer about updating the Foxit plugin. Firefox tags the Foxit plugin as potentially unstable, so it turns out I had another program killing the plugin's startup process so it was always disabled in firefox. I reenabled its startup process and updated the plugin. To get firefox to use it as the main pdf reader I went to options>applications and changed the option for pdf to the foxit plugin and everything works dandy now! Thanks again!

  • Displaying PDF in new Browser window

    Hi all,
    I have a question about displaying a invoices in pdf format in a new window. I read several threads about this, but I haven't been able to solve my problem.
    I'm using following code:
    append the pdf to the response
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename  = 'test.pdf'
        i_content   = lx_pdf
        i_mime_type = 'application/pdf'
        i_in_new_window = ' X'
        i_inplace       = 'X' ).
    The content (lx_pdf) is retrieved from a smartform, via the function module for the smartform in question, after which I convert the OTF Data (JOB_OUTPUT_INFO-OTFDATA) to XSTRING using FM SCMS_TEXT_TO_XSTRING. The returned data (buffer of type xstring) I use for afore mentioned method. But all I get to see is the following:
    //XHPLJIIID    0700 00000000001
    IN04EZZ_MO_SMARTFORM_TEST
    IN05TEST_PAGE_1
    OPDINA4   P 144  240 1683811906000010000100001
    IN06MAIN
    IN06TEXT_TEST1
    MT0168902156
    CP11000000E
    FCCOURIER 120  00144 SF001SF001110000144E
    UL +0000000000000
    CT00000000
    ST0590441This is a text page for displaying PDF in a
    MT0168902396
    ST0547238new window
    MT0168902636
    ST0460832called from within a WD application
    MT0168902876
    ST0144010Application
    EP
    The text is correct, but it is not displayed as PDF in new window, and of course I'm not interested in all the formatting codes in front of every line??
    I should be possible to display a pdf in a new browser window without having installed everything needed for Adobe Interactive forms, or isn't it??
    Kind regards,
    Micky.

    Hi Micky.
    If you have the spool number of the printed billing document you can use
    component WDK_SPOOL_TO_PDF in order to display spool as PDF.
    Just transfer spool number and format to default inbound start up plug.
    Cheers,
    Sascha

  • Problems displaying PDF files in browser - Help requested

    The scenario is that I visit a website that has information available via a link that normally would open a PDF document in a browser window.  The sort of document, that once open, if I clicked 'File-save as' in the browser would immediately save as a PDF file.  In the current situation I click on the link and all I get that opens is a screen full of random characters from top to bottom.  I have tried right click 'file save as' on the link that would open the PDF in the browser, but all it wants to save is a .PNG file, i.e. http://echa.europa.eu/echa-styled-theme/images/doc_lang/en.png - which is what I get from right click 'properties' on that link which should open the PDF in the brawser - normally I would see a .PDF file described. I therefore can't even download the file to open as a PDF direct from a stored location on my own PC - all it seems to see is the graphics format - this probably why when the browser goes to open the PDF file I get the random characters, i.e. the application is doing its best to translate what it does see.  I would be grateful for some advice.  Pertinant information follows:
    1.  It happens across more websites than just one example that I've quoted.
    2.  It happens on my desktop only - I don't have the problem on 4 other portable computers, including ones running the same O/S
    3.  Desktop is running Windows Home Pro, all updates executed, running the latest version of Acrobat reader with all updates executed - I tried yet another uninstall, reboot, new download, reinstall, reboot etc. yesterday.  Desktop is HP Pavillion with 12GB RAM
    4.  I get the random character display when running IE9 on the desktop, I have also replicated the problem with other versions of IE installed instead.  If I try using Chrome as a browser it goes away and tries and just fails to open the link entirely and reverts to the original page.
    5.  I've already checked online for similar problems and can confirm that all the Adobe plugins are installed per what seems standard advice I have also checked the internet settings in Adobe Acrobat preferences and all seems fine.
    6.  Thing like the browsers and Adobe arobat are running as per their standard set-ups with nothing else done to these.
    7.  Any other PDF files stored on the hard drive of the desktop open in Acrobat reader without problems
    8.  Acrobat reader version is 11.0.06.70
    Any assistance to open the PDF files in the browser and get it working particularly with IE would be great, I am quite IT literate and can try most things.  Many thanks

    Moderator
    I have no idea how to edit the above message, but apparently it has been rejected.  I cannot understand why, I am a regular contributor in many forums and have never suffered the indignity of having had a message rejected before.  The message contains an excellent example of the problems I am having in the following link Vacancies
    How on earth can I demonstrate the problems I am having without being to post an example - that example has both sorts of links on one page, ones I can open and ones I can't - if anyone with technical knowledge is trying to help me then that is just the sort of page that would be useful to help solve the problem.  Rather than the link to the ECHA website in the above posting (which I note was approved).  I struggle with your logic in accepting one message and rejecting the other.  It is difficult enough as a user to describe a problem in words let alone have the best example of the problem rejected without explanation and no right of appeal on the email that I got telling me.  Not happy here!   All I am trying to do is to solve the problem I have

  • Display PDF files in Browser

    How can I display PDF files in my browser. SARS reqire it for e-filing?

    Previous error message was working with Explorer. This came up working with Firefox
    I did upgrade and it was found that the latest version was installed.
    Please wait...
    If this message is not eventually replaced by the proper contents of the document, your PDF
    viewer may not be able to display this type of document.
    You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by
    visiting http://www.adobe.com/products/acrobat/readstep2.html.
    For more assistance with Adobe Reader visit http://www.adobe.com/support/products/
    acrreader.html.
    Regards
    Allen Versteeg

  • Display PDF in Web Browser Setting

    Good Morning,
    We recently encountered some issues with Adobe 9.0.0 on Citrix servers. We updated to Version 9.3.4, since we had not fully tested Reader X yet.
    The issue is that we have an application that calls to Adobe and opens PDF files within the application.  When I log on to the citrix server locally, the setting Display in PDF Browser is selected.  My account is an admin of our domain. When I log in to the server with a standard account, the setting is not selected.
    I found the bBrowsing Integration key in HKCU\Software\Adobe\Acrobate Reader\9.0\Originals and when I am logged in with admin account it is set to 1, when I login with the non-admin account it is set to 0.
    The same key also appears in HKEY_Users\.Default\Software\Adobe\Acrobat Reader\9.0\Originals.  My question is this, can I set this globally on my Citrix servers so that the Display PDF is Browser is selected. when users login to Citrix Presentation Server, launch the applications that call to Adobe, that the pdf open in a web browsers of the applications. Currently, if you hit the link the PDF file will open in its own window.
    Sorry if this is a bit wordy, but I figure it is best to give too much info as opposed to not enough.
    Thank You
    Brian Dougherty

    Yes the pdf is opening in adobe. But I don't want to open a new adobe browser to open.
    I want to display in the current web browser where my application is running.
    eg. if u are embedding pdf file like this.
    <EMBED src="temp1.pdf" width ="750" height="550"></EMBED>
    It won't open the new window. It displays the result in the current window.
    I have my pdf content in byte array. To wirte the above code i need a file. I even writes the byte array to a temporary pdf file. But I can't able to import that file dynamically to the WSAD workspace.
    Is there any other way to embed the (byte array)pdf file in the current window.
    Please advice me.
    Thanks in advance.

  • Adobe Reader won't display PDF in IE Browser Window

    I am using Adobe Reader XI and Internet Explorer v. 11.0.9600.17280.
    I have tried uninstalling and re-installing Adobe.  I've also checked IE Add-Ins and all Adobe Reader Add-Ins are enabled.
    However, you're poorly written software STILL WILL NOT display PDFs in browser any more.
    I need help, but since you're software is so horrible, you do not offer typical technical support.
    PLEASE HELP!

    My company is having the same problem and I was hoping for some kind of final explanation.
    The fix of resetting the Internet Explorer settings works for a time, then it later it has the problem again.  Our company has a reporting site which needs the documents to open in the browser to allow for drill down(generating another report based on a link in the document), so the reports have to be in the browser not a separate Adobe Reader Window.  We have tried other fixes on the Web like the TabProcGrowth=1, but still the problem happens later.
    Our users are tired of resetting their Internet Explorer settings every week or more.  As this has worked in all previous versions, I would agree the issue probably lies in Internet Explorer or at least partly in Internet Explorer, but we need some way to keep the files opening in the browser rather than a separate Reader window.  Any additional thoughts or fixes by anyone would be greatly appreciated.

  • Displaying *.pdf file on browser with servlet

    hi all
    this RAMESH,struggling to display a pdf file on browser from a remote mechine
    earlier i tried with servlet
    response.setContentenType("application/pdf")
    out.println();
    by this i am getting only some data as below
    endobj
    4 0 obj
    <<
    /ProcSet [ /PDF /Text /ImageB ]
    /Font << /Fo0 21 0 R /Fo12 24 0 R /Fo13 27 0 R /Fo16 30 0 R /Fo18 33 0 R /Fo19 36 0 R >>
    >>
    endobj
    For this purpose i have gone thru www.lowagie.com
    and gone thru all examples but i am not getting how to display on browser or at least awt frame
    please requesting all for suggest me some way
    tanks all
    -Ramesh

    are you trying to
    a) create a PDF dynamically
    b) send an existing PDF

  • How to get Firefox to display pdf file in browser (Win 7, FF 19.0, AA 10.1.6, IE 9)?

    After Firefox updated to version 19, when I tried to view a pdf file, the file appeared in a strange new viewer. Seemed to work OK, but I was concerned (didn't know that it is apparently a new feature of FF 19), and wanted the Adobe viewer back.
    After a few minutes of viewing in the FF pdf viewer, a message appeared that said something like-- This viewer may not be displaying the document correctly. Would you like to use Adobe Acrobat instead?-- I clicked yes.
    Now, when I click a link for a pdf file, it will either open automatically in Adobe Acrobat (windows application, not viewer within FF), or I'll get a dialog that asks whether I want to save the file or use Adobe Acrobat to open it.
    I have followed the instructions here:
    http://support.mozilla.org/en-US/kb/use-adobe-reader-plugin-view-or-download-pdf-files?esab=a&s=view+pdf+in+browser&r=0&as=s
    Including:
    http://support.mozilla.org/en-US/kb/view-pdf-files-firefox-without-downloading-them
    http://support.mozilla.org/en-US/kb/view-pdf-files-firefox-without-downloading-them#w_using-a-pdf-reader-plugin
    http://support.mozilla.org/en-US/kb/view-pdf-files-firefox-without-downloading-them#w_check-application-settings
    Delete the mimetypes.rdf file
    Delete the pluginreg.dat file
    Let me know if you think I've missed any info that would be helpful. Now that I know the new PDF viewer is FF native, I wouldn't mind trying it out.
    Thanks!
    Who
    repair of Adobe Acrobat
    If I start IE and click a pdf link within IE, I can view a PDF file within IE, but who wants IE?

    Hi madperson,
    It seems like there is some progress. After setting pdfjs.disabled to true, when I click on a pdf link, it still only asks me if I want to open the file with (application list) or save the file. However, when I look at the options dialog>applications, the selection for pdf documents changed from use plugin to use Adobe Acrobat Reader (not plugin). I scrolled through the selection list, but the Adobe plugin was not listed. However, when I look at the add-ons screen, the Adobe Acrobat Reader plugin is listed at the top. So, it seems like the plugin is installed, but firefox doesn't know it's there...somehow.
    How do I uninstall the Adobe Acrobat Reader plugin and re-install? Can I just do that? Or, do I need to uninstall/reinstall the entire Adobe Acrobat Reader application?
    Thanks
    Who

  • Displaying PDF file in browser

    Hi,
    I want to display a PDF file in a browser which I have generated at runtime.
    I do it in this way:
    HttpServletResponse response = ((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletResponse();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    File pdfFile = new File("report1.pdf");
    try{
        baos.write(getBytesFromFile(pdfFile));
        response.setContentType("application/pdf");
        response.setContentLength(baos.size());
        ServletOutputStream out = response.getOutputStream();
        baos.writeTo(out);
        out.flush();
    catch(IOException ioe){
    If I put this code to a simple project (single view with this code only) its working fine. But if I want to display the file in a project which contains other functions and views it doesnt work (when the pdf should appear the application freezes).
    Can anyone help me?
    Ivo

    public int CreaFilePdf( )
           //@@begin CreaFilePdf()
           int ret = 0;
           byte[] pdfFoXMLFile = null;
           byte[] pdfFile;
           IWDCachedWebResource cachedPdfResource = null;
           String fileName = new String();
           String foText = new String();
           try {
                foText = this.toFoXML();
                wdContext.currentContextElement().setFoText(foText);
                pdfFoXMLFile = foText.getBytes("UTF-8");
                fileName = "Equipment.pdf";
                OutputStream outFo = new java.io.FileOutputStream("Equipment.pdf.fo");
                try {
                     outFo.write(pdfFoXMLFile);
                     outFo.flush();
                     outFo.close();
                } catch (IOException e2) {
                     // TODO Auto-generated catch block
                     e2.printStackTrace();
                /////////////fo to PDF
    //            Construct driver
                Driver driver = new Driver();
                //Setup logger
                Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
                driver.setLogger(logger);
                MessageHandler.setScreenLogger(logger);
                //Setup Renderer (output format)       
                driver.setRenderer(Driver.RENDER_PDF);
                OutputStream out = new java.io.FileOutputStream("EquipmentFromFo.pdf");
                try {
                     driver.setOutputStream(out);
                     //Setup input
                     InputStream in = new java.io.FileInputStream("Equipment.pdf.fo");
                     try {
                          driver.setInputSource(new InputSource(in));
                          //Process FO
                          driver.run();
                     } finally {
                          in.close();
                } finally {
                     out.close();
                /////////////fo to PDF          
    //     /////////////////////////////web resource
         try {
           // create Excel 2003 XML data as a byte array for the given context node, attributes and headers 
           // Deserialize from a file
           File file = new File("EquipmentFromFo.pdf");
           // Get some byte array data ----> THIS  method is here: <a class="jive_macro jive_macro_message" href="" __jive_macro_name="message" modifiedtitle="true" __default_attr="2735976"></a>
           pdfFile = getBytesFromFile(file);
           //pdfFoXMLFile = this.toFoXML().getBytes("UTF-8");
           // create a cached Web Dynpro XLS Resource for the given byte array and filename
           //HERE create the URL object
           cachedPdfResource = this.getCachedWebResource(pdfFile, fileName, WDWebResourceType.PDF);
           // Store URL and filename of cached excel resource in context for UI linkToURL.
           if (cachedPdfResource != null) {
              wdContext.currentContextElement().setPdfFileURL(cachedPdfResource.getURL());
              wdContext.currentContextElement().setPdfFileName(cachedPdfResource.getResourceName());
           } else {
              ret = 1;
         catch (WDURLException e) {
              ret = 1;
           } catch (FileNotFoundException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
           } catch (IOException e2) {
                // TODO Auto-generated catch block
                e2.printStackTrace();
           } catch (FOPException e3) {
                // TODO Auto-generated catch block
                e3.printStackTrace();
           return ret;
           //@@end

  • Acrobat not displaying PDFs properly in browser

    this seems to only happen on chrome where if viewed in browser some graphics, especially text isnt displayed properly or in this case not at all. You can see the "Fi" in financial is missing. This is a major problem because most people who view the site are hitting download and the PDF is being opened automatically within browser. Is there a fix for this? Did I export wrong in Indesign? Do fonts have to be rendered into an object before exporting as PDF (thats a hassle)?
    BUT a quick fix is to download the PDF, view in browswer then refresh the page and all fonts display. Weird. This is a step that many will miss.
    This is what it looks like when downloaded and viewed within acrobat. note the thicker font

    You are probably viewing the PDF file in the Google Chrome PDF viewer and NOT the Adobe PDF Viewer. 
    1.  Check your plug-ins by going to:
    chrome://plugins
    2.  Go to the entry Chrome PDF Viewer.
    3.  If you see (enabled) then you are using Chrome's  PDF viewer.
    It's lacking in a lot of ways for functionality.  Fonts is one of them.
    4.  You can disable it
    5.  Then go to the the listing for Adobe Reader
    Adobe PDF Plug-in For Firefox and Netscape <versionNumber>
    6. Then enable it.
    7.  Done

  • Display pdf file on browser

    Hi,
    I am using struts 1 in my web application. I have to show a pdf, placed on my local machine, on the browser. So how should i proceed?
    Thanks
    Edited by: 848168 on Mar 29, 2011 12:37 AM

    By "placed on my local machine" do you mean that the file is on the server or on the client side?
    If it's on the server, the best you can do is run a file servlet and set the right content type and other headers. What happens to it on the client side is out of your control. e.g The client machine may not even have a pdf viewer.

  • When I try to display .pdf file in browser (with proprietry extension .dnax) I get the error message "A plugin is needed to display this content".

    I am trying to display a .pdf file within Firefox on a Vista PC. I have changed the extension from .pdf to .dnax to differentiate this .pdf file from others. I get an error message as above.
    The file is displayed using Firefox on another PC with a Linux OS without problem.
    Any advice out there?

    Firefox typically judges the nature of a document or download based on the content-type header send by the web server. Usually a server has a catalog associating file extensions with content types. When you choose a new file extension, the server may send the generic "it's some kind of binary file" header ("application/octet-stream") which Firefox will not associate with a particular program.
    Now, when you open a file from the local system, there is no web server, so Firefox may look to the file extension to ascertain the content type. Obviously that is not working in your case. What happens when you want to open the file from My Computer or Windows Explorer? Does Windows have an application assigned to it? If you can associate it with Adobe Reader in Windows, Firefox may be able to pick that up from the Windows registry.

Maybe you are looking for

  • Analysis Authorization not working - Empty demarcation

    Can someone help me on this Analysis Authorization? I read many threads in SDN, it seems that I followed the correct steps. The restriction on S_RS_COMP is working well but the restriction on the Analysis Authorization is not working. Surely I'm maki

  • Need help please! boot camp related

    Im in desperate need of help. Heres the story: I partioned my drive to 100 gb windows (xp home), with about 131 gb for Leopard. I followed the prompts during the installation, until i got to the screen listing the available drives for installing wind

  • Error In Flex.....

    <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="library://ns.adobe.com/flex/mx" layout="vertical" width="100%" height="100%" initialize="initApp()"

  • Master Detail with Search

    Hi All, I have created a Master (Form with Navigation buttons) - Detail (table) with search region. Intially both regions show no data as expected. When I search for an entry in Master region - It shows the data in Master but not in Details region. W

  • Powermac g5 single-1.8ghz & new ram

    i recently took upon a powermac g5 1.8ghz single core system with 1gb of memory and wanted to know if this memory would work inside of it aswell: http://www.newegg.com/Product/Product.aspx?Item=N82E16820161161