Html db to display pdf files saved as blob in the data base

Hi all,
I have a DB page to call next page to display pdf files.
A procedure is being called when the link is clicked on the first page.
However, the procedure output a juck code insteand the pdf files. Please help.
Thanks,
n_length number;
n_image BLOB;
begin
select note_image, dbms_lob.getlength(note_image)
into n_image, n_length
from n100_notes where note_id = nid;
owa_util.mime_header('application/pdf');
htp.p('Content-length: ' || n_length);
wpg_docload.download_file(note_image );

we use:
owa_util.mime_header('application/pdf',false);
htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
owa_util.http_header_close;
wpg_docload.download_file(l_blob);
see plpdf.com
LL

Similar Messages

  • Displaying PDF files (stored as BLOBs in Database) using Forms 6i

    Hi,
    We have PDF and Word documents stored in Database (Version 8.1.7). We are using Oracle Forms 6i as User Interface. Through Forms we could view word documents which are stored in database, using OLE container.
    But we could not view PDF files.
    It would be more helpful and valuable if I get ideas/suggestions on this.
    Thanks in advance,
    Umasankar

    Frank,
    You are correct, I totally agree with you.
    TOAD software which i suggested was not for user interface but more for testing purpose - To ensure that the documents is uploaded to BLOBS correctly.
    I am not a WEB person, but I believe sugnificant coding is required in forms6i/9i with WEB features to display the respective documents.
    If, the purpose in ONLY for testing, then TOAD can be used which requires no coding.
    -- Shailender Mehta --

  • Displaying PDF file from database BLOB

    I have successfully added a PDF file to a table as a BLOB. Now, I need to display the BLOB. I have created the following package but it does not display anything. Can someone please help?
    SQL> create or replace package image_get
    2 as
    3 procedure pdf( p_id in demo.id%type );
    4 end;
    5 /
    Package created.
    SQL> create or replace package body image_get
    2 as
    3
    4 procedure pdf( p_id in demo.id%type )
    5 is
    6 l_lob blob;
    7 l_amt number default 30;
    8 l_off number default 1;
    9 l_raw raw(4096);
    10 begin
    11 select theBlob into l_lob
    12 from demo
    13 where id = p_id;
    14
    15 owa_util.mime_header( 'image/pdf' );
    16 begin
    17 loop
    18 dbms_lob.read(l_lob,l_amt,l_off,l_raw);
    19 htp.prn(utl_raw.cast_to_varchar2(l_raw));
    20 l_off := l_off+l_amt;
    21 l_amt := 4096;
    22 end loop;
    23 exception
    24 when no_data_found then
    25 NULL;
    26 end;
    27 end;
    28 end;
    29 /
    Package body created.
    SQL> DECLARE
    2 l_pdf int(1);
    3 begin
    4 l_pdf := 1;
    5 image_get.PDF(l_pdf);
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2 Image1 BLOB;
    3 ImageNum NUMBER := 1;
    4 BEGIN
    5 SELECT TheBLOB INTO Image1 FROM demo
    6 WHERE id = ImageNum;
    7 DBMS_OUTPUT.PUT_LINE('Size of the Image is: ' ||
    8 DBMS_LOB.GETLENGTH(Image1));
    9 /* more LOB routines */
    10 END;
    11 /
    Size of the Image is: 14064
    PL/SQL procedure successfully completed.
    SQL> exit
    Am I missing something? I recently discovered that I need to set SERVEROUTPUT on to display the DBMS_OUTPUT. Is their some other environment variable I need to set.
    Thanks!

    *Always post code wrapped in <a href=http://wikis.sun.com/display/Forums/Forums+FAQ#ForumsFAQ-Arethereanyusefulformattingoptionsnotshownonthesidebar?"><tt>\...\</tt> tags</a>:*
      PROCEDURE lf_html_pdf (pv_image IN VARCHAR2, pv_index IN NUMBER) is
         l_mime        VARCHAR2 (255);
         l_length      NUMBER;
         l_file_name   VARCHAR2 (2000);
         lob_loc       BLOB;
      BEGIN
          begin
            selecT OI_BLOB,DBMS_LOB.getlength (OI_BLOB)
            into lob_loc,l_length
            from ord_img
            where  oi_tno= pv_image
              and oi_ti='PDF'
              and oi_idx=pv_index;
          exception
                when others then
                null;
            end;
         OWA_UTIL.mime_header (NVL (l_mime, 'application/pdf'), FALSE);
         HTP.p ('Content-length: ' || l_length);
         OWA_UTIL.http_header_close;
         WPG_DOCLOAD.download_file (lob_loc);
      END lf_html_pdf; Start by getting rid of:
          exception
                when others then
                null;and never using it anywhere ever again.
    If you're not actually going to use the <tt>l_mime</tt> and <tt>l_file_name</tt> variables then remove these as well. (Although I really think you should set a filename.)
    >
    Error report:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 356
    ORA-06512: at "SYS.OWA_UTIL", line 415
    ORA-06512: at "HCLABPRO.PKG_PDF", line 220
    ORA-06512: at line 2
    06502. 00000 - "PL/SQL: numeric or value error%s"
    >
    The error stack indicates that the exception is being raised in <tt>HCLABPRO.PKG_PDF</tt>: what is <tt>HCLABPRO.PKG_PDF</tt>? Does this actually have anything to do with the procedure above?
    I get the error message as below when i execute the procedure above;How do you execute it?
    What happens when it's executed without the <tt>when others...</tt> built-in bug?

  • How to display binary file saved in BLOB column in Discoverer PLUS /VIEWER

    HI, Friends,
    I tried to display the binary file saved in the database in BLOB column with the *.doc or *.xls fomats, but it seemed not work at all. I can display them in discoverer DESKTOP, but not the web version PLUS or VIEWER. MY Discoverer PLUS/VIEWER version is 9.0.4.45.02 and the database is 9.2.0.4. Are there any special setting/configuration in somewhere (Discoverer administration/Applicaiton server/PLUS/VIEWER?)
    Any help /information will be greatly appreciated.
    Thanks a lot.

    Hi,
    Sorry but this feature is not available in the web version of 9.0.4.45. You will have to write your own mod_plsql function to download the file.
    Rod West

  • Using my PC Desktop I am trying to convert a PDF file to excel.  When the data is imported to Excel the majority of the data is vertical in the far left colum.

    I am trying to import a PDF file from my desktop PC in to Excel using XI Pro.  When the data imports in to excel, the majority of the data is vertical along the far left comumn instead of horizonal along the colums such as name, address, etc.   I need to be able to import the data in to the horizonal categories so I can categorize the data after it is in excel.  Thanks.

    Hi johnc,
    I'm sorry to hear that your file didn't convert well for you. Can you please tell me more about the PDF that you're trying to convert? Do you know how it was created? The quality of a conversion depends on the quality of the PDF, and it sounds like the file you have may not include the tagging information that is required to convert that properly into an Excel file. Would you be willing to share that file with me? If so, let me know and I'll send you a private message with my contact details.
    Best,
    Sara

  • I am using i padmini with retina display. i was curious to know if the pdf files saved on adobe reader app are safe from any hacking

    I am using i padmini with retina display. i was curious to know if the pdf files saved on adobe reader app are safe from any hacking

    If they are saved on your iPad, they are as safe as anything else.
    Barry

  • I need to configure Acrobat to display PDF files in Safari, but I have a lot of troubles to do it.I have OX S yosemite, I unistalled adobe acrobat, I closed safary and I installed the new version of adobe acrobat.

    Dear everyone
    I need to configure Acrobat to display PDF files in Safari, but I have a lot of troubles to do it.
    I read a european commission document explaining that
    http://ec.europa.eu/research/participants/data/support/sep_usermanual.pdf
    If Safari does not display pdf forms in the browser window, uninstall all older versions of Adobe Reader and download the most recent one. First close Safari and then install Reader. Launch Safari and you ought to be able to open the pdf files inside the Safari window. If you install Adobe Reader 10.1.x without first closing Safari, Safari will not display the pdf file inside its browser window until it is re-launched. For further help, please see http://helpx.adobe.com/acrobat/kb/troubleshoot-safari-plug-acrobat-x.html
    I have OX S yosemite, I unistalled adobe acrobat, I closed safary and I installed the new version of adobe acrobat
    but when I open a web page that I need to allow me to display and modify PDF files it is not working.
    I checked the following web page
    Troubleshoot Safari plug-in | Acrobat X, Reader X
    that is recommending the following:
    The AdobePDFViewer plug-in is used to display PDF files in Safari using Acrobat and Reader.
    This plug-in is installed as part of the Acrobat X or Reader X installation. The location of this plug-in is:
    /Library/Internet Plug-ins/AdobePDFViewer.plugin
    but after the new installation with this folder is completely empty and I am still
    unable to open these pdf.
    Does anybody knows anything else I can do?
    Best regards
    Ramon

    Moving this discussion to the Adobe Reader forum.

  • Does anyone know why after upgrading to Mavericks, Safari will not display PDF files, is there a solution?

    I cannot get Safari to display PDF files, it shows a blank screen with the comment that Safri has blocked PDF, however when you unblock it still does not show the PDF, I have had to rely on Firefox for this, which I find not too good. Any help very much appreciated.

    Update to 10.9.1
    Adobe Reader
    http://helpx.adobe.com/acrobat/kb/blocked-plugin-alert-safari-7.html
    Best.

  • How to display Pdf file in iPad site

    Hi
    How to display Pdf file in web page which can able to view in iPad safari?
    Thanks,
    Arun

    You can't really.
    You need to use DHTML in the swf-wrapper HTML file, usually a
    division wrapped iFrame, and load the PDF into the iFrame as an
    overlay to the Flash.

  • Display PDF files in a NEW window

    hi there
    i offer PDF files to download on most of my webpages. example: http://www.khanomTOPproperty.com/khanomTOPproperty.com/northofkhanom.html
    i would like them to load in the browser first (not automatically download), but in a NEW WINDOW, and then give the visitor the option to download it (which is the easy part of it).
    even if i don't focus on opening in a new window (which is what i have now online, to make it available at last) the problem is that not all browsers display the file. some download it immediately. it took me quite a while to find out how different browsers handle it, and since it is very different i made a "browser ABC" help page on my site, explaining the different behaviors of browsers (http://www.khanomTOPproperty.com/khanomTOPproperty.com/browser_help.html). safari is great as usual and displays the file, so one can downoad it then (or not), but google chrome (and others) immediately download them without displaying them. by the way, i did NOT zip the files.
    so, how to make it sure that the files are displayed (not directly downloaded) in every browser, and, as mentioned above, i would love to have it in a NEW WINDOW( or tab, but better window), to make it easy to go back to the previous page without having to reload.
    and yes, i too think ISSUU is great in terms of display, i tried it but immediately forgot it when i found out that the visitor has to log in first (actually become a member of ISSUU) before being able to download - and i don't want to force my visitors to such things - the same way i will never have any advertisement on any of my pages - i don't want to make visitors angry...
    thanks again, i know - lots of questions, but the result of a few weeks iWeb work, and i did not find the answers in the forum yet.
    george

    hi wyodor
    oh wow, you answer almost faster than i can ask - that's what i call turbo.
    sounds very simple, and i tried it. the problem is that it is not so easy to make this link. i tried to find one of the several PDF files i have to make a test, but even this was not so easy. in cPanel i have a window which pops up when i open the file manager. it gives the option to access through
    a) home directory
    b) web root (public_html/www)
    c) public FTP root (public-ftp)
    d) document root for:
    (and then the domain names)
    which one is the right one to enter if i want to go to my PDF files? yes, OK, not an iWeb question, but maybe you can...
    anyway. i managed somehow to get to the PDF files. to my surprise i have seen that each file is there not only one time, but twice (the second time with a "_1"PDF. any idea what happened there? i only need one, do i?
    OK. so i found one, localized it but still can not get the link for it. the only link i find (in the browser address bar) is the FOLDER where the PDF files are located. i don't think this will do it, as i guess i have to specify the file exactly, otherwise how can iWeb know which file i want?
    how can i get a link to this file?
    additional question: whenever i update my website, will this path be remembered? i guess so.
    practically this means i will (should i be successfull and be able to create a link to these files) have to upload the PDF files BEFORE i can create the link in iWeb, Yes?
    you see, i am really a professional (...) - if i would i would probably switch to the other side and help greenhorns like me in the forum.
    by the way - are aou working for apple or is this just some sort of hobby?
    thanks again and warm regards
    george

  • How to display pdf file with java code?

    Hi All,
    i have a jsp pagein that page if i click one icon then my backing bean method will call and that method will create pdf document and write some the content in that file and now i want to display that generated pdf document.
    it should look like you have pressed one icon and it displayed pdf file to you to view.
    java code below:
    FacesContext fc = FacesContext.getCurrentInstance();
    ExternalContext ec = fc.getExternalContext();
    HttpServletResponse resp = (HttpServletResponse) ec.getResponse();
    resp.setHeader("Content-Disposition", "filename=\"" + temppdfFile);
    resp.encodeRedirectURL(temppdfFile.getAbsolutePath());
    resp.setContentType("application/pdf");
    ServletOutputStream out = resp.getOutputStream();
    ServletUtils.returnFile(temppdfFile, out);
    out.flush();
    and above temppdfFile is my generated pdf file.
    when i am executing this code, it was opening dialog box for save and cancel for the file, but the name of the file it was showing me the "jsp file name" with no file extention (in wich jsp file i am calling my backing bean method) and type is "Unknown File type" and from is "local host"
    it was not showing me open option so i am saving that file then that file saved as a pdffile with tha name of my jsp file and there is nothing in that file(i.e. empty file).
    what is the solution for this. there is any wrong in my code.
    Please suggest me.
    Thanks in advance
    Indira

    public Object buildBarCodes() throws Exception
    File bulkBarcodes = null;
    String tempPDFFile = this.makeTempDir();
    File tempDir = new File("BulkPDF_Files_Print");
    if(!tempDir.exists())
    tempDir.mkdir();
    bulkBarcodes = File.createTempFile
    (tempPDFFile, ".pdf", tempDir);
    //bulkBarcodes = new File(tempDir, tempPDFFile+"BulkBarcode"+"."+"pdf");
    if(!bulkBarcodes.exists())
    bulkBarcodes.createNewFile();
    Document document = new Document();
    FileOutputStream combinedOutput = new FileOutputStream(bulkBarcodes);
    PdfWriter.getInstance(document, combinedOutput);
    document.open();
    document.add(new Paragraph("\n"));
    document.add(new Paragraph("\n"));
    Image image = Image.getInstance(bc.generateBarcodeBytes(bc.getBarcode()));
    document.add(image);
    combinedOutput.flush();
    document.close();
    combinedOutput.close();
    FacesContext facesc = FacesContext.getCurrentInstance();
    ExternalContext ec = facesc.getExternalContext();
    HttpServletResponse resp = (HttpServletResponse) ec.getResponse();
    resp.setHeader("Content-Disposition", "inline: BulkBarcodes.pdf");
    resp.encodeRedirectURL(bulkBarcodes.getAbsolutePath());
    resp.setContentType("application/pdf");
    resp.setBufferSize(10000000);
    ServletOutputStream out = resp.getOutputStream();
    ServletUtils.returnFile(bulkBarcodes, out);
    out.flush();
    return "success";
    This is my action method which will call when ever i press a button in my jsp page.
    This method will create the barcode for the given barcode number and write that barcode image in pdf file
    (i saw that pdf file which i have created through my above method, This PDF file opening when i was opening manually and the data init that is also correct means successfully it writes the mage of that barcode)
    This method taking the jsp file to open because as earlier i said it was trying to open unknown file type document and i saved that file and opended with editplus and that was the jsp file in which file i am calling my action method I mean to say it was not taking the pdf file which i have created above it was taking the jsp file

  • 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

  • Use PHP to convert html page to a pdf file for email

    I want to use my php scripts to send an email (with a pdf attachment) of the web page that is being viewed.
    My problem I have no way to convert the html page to a pdf file without the end user being prompted to (1) naming the file (2) saving it
    Is there a program or a way i can save the html as "auto_name.pdf" file on the server without user input?
    I have Adobe Acrobat 6.0 Professional on server

    There are lots of good Html to Pdf conversion tools for developers, both free and paid. I'd suggest to take a look at PD4ML Html to Pdf converter - it has lots of features (CSS support, page layout presets, etc.) and can be obtained for free for non commercial usage. There is also a topic at Stackoverflow with a list of such converters.

  • How to display PDF file in OAF page

    Hi All,
    I have an requirement to display a PDF file in OAF page. The PDF file will be stored in custom location in unixbox and when the user clicks on the hyperlink from OAF page, the PDF file should be promted to open or save the file in the local system.
    The pdf file will be stored in $XBOL_TOP and I am not sure on how to link the file directory path from OAF page.
    Please share some information on how to achieve this logic.
    Regards,
    Ram

    Hi,
    Did you find a way to do this.
    Please advise.
    Thanks
    Krishna
    Edited by: user452458 on May 11, 2010 6:53 PM

  • How to display pdf file in windows phone 8 silver light application?

    Hi,
    I am developing windows phone 8 silver light application . For my app I want to display pdf files . Is there any default controls to display pdf files ?
    I don't want to display using launchers , I want to display with in the app.
    any help,
    Thanks..
    Suresh.M

    Probably this should give you a fair idea : How to view PDF file inside an Windows Phone application?
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

Maybe you are looking for