Display blob content as pdf file

Dear Expert,
Currently i'm using oracle apex 3.0.1.
I'm having a problem on displaying blob content (from database table) as pdf file on oracle application express but i'm able to save to download the pdf.
Below is the procedure that i used to display blob content,
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;
I get the error message as below when i execute the procedure above;
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"*
I'm appreciated if expert can have me on the problem above?
Thanks
From junior

*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?

Similar Messages

  • Table of contents in PDF files

    IBooks gives two options for displaying the Table of Contents for PDF files—thumbnails or a conventional table. The thumbnails view is useless to me, and I would like the conventional table view to appear by default. Unfortunately, the TOC almost always appears in thumbnails view, and I have to manually select the list view.
    Is there any way to set the list view as the default TOC view for PDF files?
    Thanks.

    Hi Michael,
    When you combine files into a single PDF, each file you include will have a bookmark in the Bookmarks panel in Acrobat/Reader. So, I suppose you could treat that as a Table of Contents. (It doesn't, however, create a separate TOC and append it to the file.) The bookmark names reflect the filename of each file you combined.
    I hope that answers your question.
    Best,
    Sara

  • How to display the content from a file  stored in database

    when i am trying to display the content from a file which stored in database on oracle report 10g
    data are displaying as following. please help me to display the data in readable format
    <HTML LANG="en-US" DIR="LTR">
    <!-- Generated: 1/11/2006, postxslt.pl [1012] v1
    Source: amsug304286.xml
    File: amsug304286.htm
    Context: nil
    Tiers: ALWAYS
    Pretrans: YES
    Label: Release 12 -->
    <HEAD>
    <!-- $Header: amsug304286.htm 120.4 2006/11/01 20:57:29 appldev noship $ -->
    <!--BOLOC ug1_OMPO1010302_TTL--><TITLE>Product Overview (ORACLE MARKETING)</TITLE><!--EOLOC ug1_OMPO1010302_TTL-->
    <LINK REL="stylesheet" HREF="../fnd/iHelp.css">
    </HEAD>
    <BODY BGCOLOR="#F8F8F8">
    <A NAME="T304286"></A><A NAME="ProdOve"></A>
    <CENTER><H2><!--BOLOC ug1_OMPO1010302--><B>Product Overview</B><!--EOLOC ug1_OMPO1010302--></H2></CENTER>
    <p><!--BOLOC ug1_OMPO1010304-->Oracle Marketing drives profit, not just responses, by intelligently marketing to the total customer/prospect base. By leveraging a single repository of customer information, you can better target and personalize your campaigns, and refine them in real time with powerful analytical tools.<!--EOLOC ug1_OMPO1010304--></p>
    <p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
    <ul>
    <li>
    <p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
    </li>
    <li>
    ls.<!--EOLOC ug1_OMPO1010304--></p>
    <p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
    <ul>
    <li>
    <p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
    </li>
    <li>
    <p><!--BOLOC ug1_OMPO1006613--><B>Sales Alignment</B> - Oracle Marketing's leads management helps you compile and distribute viable leads so that sales professionals can follow up valuable opportunities and not just contact interactions. Additionally, support for distributing proposals and marketing material drive speedy and consistent setups and collaboration of best practices.<!--EOLOC ug1_OMPO1006613--></p>
    </li>
    <li>
    <p><!--BOLOC ug1_OMPO1006614--><B>Marketing Insight</B> - While Oracle Marketing Home page reports and Daily Business Intelligence (DBI) for Marketing and Sales provide aggregated management level information in almost real time, operational metrics help in tracking the effectiveness of individual marketing activities.<!--EOLOC ug1_OMPO1006614--></p>
    </li></ul>
    </BODY>
    </HTML>
    <!-- Q6z5Ntkiuhw&JhsLdhtX.cg&Zp4q0b3A9f.&RQwJ4twK3pA (signum appsdocopis 1162406236 2673 Wed Nov 1 10:37:16 2006) -->

    Hi,
    you can try to use the:
    <b>ConsumerTreeListPreview</b>
    layout for KM navigation ivew (or customize to your own).
    This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
    Hope this helps,
    Romano

  • Getting the page content as pdf file

    Hi All,
    I have a use case like i need to get the page content as pdf file.
    For this i found xsl file and it's config under the following locations
    /libs/cq/config/rewriter/pdf/transformer-xslt --config of source
    /libs/wcm/core/content/pdf/page2fo.xsl -- xsl file location
    For custamising this functionality i copied both confing node and xsl file under "/apps" .In the Config file i changed source to refer xsl file under /apps.But it's not taking config changes.
    I have looked into http://cqblueprints.com/xwiki/bin/view/CQ+FAQ/How+can+I+configure+the+ PDF+rewriter
    there it's saying like we need to modify the com.day.cq.rewriter.xml.XSLTTransformer class. i am not getting how to modify it.
    I need this urgently
    Thanks,
    Chinna Yadlapalli.

    This script:
    http://indesignsecrets.com/zanelli-releases-multipageimporter-for-importing-both -pdf-and-indd-files.php
    answers all your questions.
    Peter

  • Read contents inside pdf file programmatically in SharePoint

    I have a SharePoint document library, My Requirement is when user add PDF file on the document library the event receiver fire and read contents inside
    pdf file programmatically. After the start workflow according to the result of event receiver.

    If your question is about handling events in apps for SharePoint, see these links:
    http://msdn.microsoft.com/en-us/library/office/jj220048%28v=office.15%29.aspx
    http://msdn.microsoft.com/en-us/library/office/jj220051%28v=office.15%29.aspx
    If what you need is a way to extract text from the PDF inside the event handler, see this example that uses leadtools.
    http://support.leadtools.com/CS/forums/ShowPost.aspx?PostID=43894
    You should use PDF text extractor in your Event Handler code -
    You can use iTextSharp for reading content
    http://www.codeproject.com/Tips/387327/Convert-PDF-file-content-into-string-using-Csharp

  • Does Acrobat Pro read the content in pdf file and transforms it?

    Does Acrobat Pro read the content in pdf file and transforms it to xls file without the need for much changes or manual work?

    Acrobat X (Standard and Pro) will save tabular data to XLS or XLSX format, provided it can recognize the table as being a table. If the PDF has missing or incorrect structure tags, Acrobat will try to guess the table layout by the position of text and lines on the page - this works well for basic formatting but if the table has complex styling, spanned cells etc. it can lead to problems.
    Acrobat X will even attempt to export a table within a scanned document, by applying OCR during the export stage - though again this relies on the table being visually identified.
    See http://www.adobe.com/products/acrobatpro/pdf-to-word-excel-converter.html and this article on how to extract one table from a larger document.

  • Display BLOB contents to client

    I want to display the blob contents in the clients window and give him the option either to open or save the contents. I am able to read the contents from Oracle Blob Field and stored the contents in the ByteArrayOutputStream object but I am not able to open the contents for the client. I am using the following code
    Blob blob = resultSet.getBlob(1);
    int length = (int)blob.length();
    byte [] b = blob.getBytes(1, length );
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    baos.write(b,0,length);
    response.setHeader("Content-Disposition","attachment; filename="+baos );
    Please help me

    I am able to see the blob contents in the client window but the file does not show as attachment which is my main purpose-- to give the user the option either to open the file or to save the file on his machine. I am also setting the setHeader as attachment , but nothing happens....and sometimes it shows a dialog box to open my jsp file itself rather than the desired file... sending you the code ..please help
    File file1 = new File("c:\\Test.java");
    byte[] buffer = new byte[(int)file1.length()];
    BufferedInputStream is = new BufferedInputStream(new FileInputStream(file1));
    is.read(buffer, 0, (int)file1.length());
    is.close();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    baos.write(buffer, 0, (int)file1.length());
    System.out.println(baos.toString());
    byte[] pass = baos.toByteArray();
    response.setHeader("Content-Desposition", "attachment;filename=untitled.java");
    response.setContentType("application/octet-stream");
    //Send content to Browser
    ServletOutputStream servletOut = response.getOutputStream();
    servletOut.write(pass);
    servletOut.close();

  • How do I get commands to display on a "full screen" display of a downloaded PDF file?

    In recent months, more and more downloaded PDF files are displayed on my Mac Pro without the command line at the top of the page.  This makes using & managing the documents difficult, and sometimes impossible.  I can gain access to a limited number of commands by clicking on the doc, but noto nearly the range of commands available when the command line is visible.  I still have many older PDF files that display in the usual manner.  Is this a change associated with Lion or the latest Adobe update?  Or, si there a command I do not know about that will restore the command line?

    Adobe Reader for iOS doesn't have command lines.

  • How to display the content of a file in the portal?

    Hey guys, could anyone help?
    I just created a page which includes two iView, one is KM Navigation iView to display a certain repository, while the other is for displaying the content of a certain file I click in the navigation iView.
    And now the problem is when I click a file in the KM Navigation iView, it will pop up a new window to display it. How can I make it displayed in a fixed iView, which type of this iView should be?

    Hi,
    you can try to use the:
    <b>ConsumerTreeListPreview</b>
    layout for KM navigation ivew (or customize to your own).
    This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
    Hope this helps,
    Romano

  • How can I read content from PDF file stored in Oracle 9i XMLDB

    Hi Friends:
    Now I have met one question that I don`t know how to read some String , for example "Hello", from the PDF file stored in the Oracle 9i XMLDB, I have stored that PDF file into the XMLDB now, any suggestions are appriciated . Thank you in advance.

    You may be able to do something with Oracle Text. The following shows how to get an HTML rendiditon of a binary document. I think you can also get plain text instead of HTML
    set echo on
    spool xfilesUtilties.log
    connect sys/&1 as sysdba
    grant ctxapp to &2
    connect &2/&3
    begin
      ctxsys.ctx_ddl.create_policy(policy_name=>'XFILES_HTML_GENERATION', filter=>'ctxsys.auto_filter');
    end;
    create or replace package xfiles_internal_11010
    authid definer
    as
      function renderAsHTML(sourceDoc BLOB) return CLOB;
    end;
    show errors
    create or replace package body xfiles_internal_11010
    as
    function renderAsHTML(sourceDoc BLOB)
    return CLOB
    as
      html_content CLOB;
    begin
      dbms_lob.createTemporary(html_content,true,DBMS_LOB.SESSION);
      ctx_doc.policy_filter(policy_name => 'XFILES_HTML_GENERATION',
                            document => sourceDoc,
                            restab => html_content,
                            plaintext => false);
      return html_content;
    end;
    end;
    show errors
    create or replace package xfiles_utilities_11010
    authid current_user
    as
      HOME_FOLDER   constant varchar2(700) := xdb_constants.HOME_FOLDER;
      PUBLIC_FOLDER constant varchar2(700) := xdb_constants.PUBLIC_FOLDER;
      function renderAsHTML(sourceFile VARCHAR2) return CLOB;
      function transformToHTML(xmldoc XMLType, xslPath VARCHAR2) return CLOB;
    end;
    show errors
    create or replace package body xfiles_utilities_11010
    as
    function renderAsHTML(sourceFile VARCHAR2)
    return CLOB
    as
    begin
      return xfiles_internal_11010.renderAsHTML(xdburitype(sourceFile).getBLOB());
    end;
    function transformToHTML(xmldoc XMLType, xslPath VARCHAR2)
    return CLOB
    as
      html clob;
    begin
      select xmldoc.transform(xdburitype(xslPath).getXML()).getClobVal()
        into HTML
        from dual;
      return html;
    end;
    end;
    show errors
    grant execute on xfiles_utilities_11010 to public
    create or replace public synonym xfiles_utilities for xfiles_utilities_11010
    quitMessage was edited by:
    mdrake

  • Display Blob content in HTML Region

    Hello,
    I'm trying to display the contents of an .htm file in an html region. I can get it to display as a link but I can't get it to display as an image. I have a page item that is display as text (do not save state). For the source value I use a PL/SQL function body. I use the following code to display the image,
    return '<img scr="#OWNER#.get_help_doc?p=U76.htm></img>';
    I get the broken link symbol.
    However, if I display it as a link as follows, it works:
    return '<a href="#OWNER#.get_help_doc?p=U76.htm'
    || '">Help</a>';
    How can I display the .htm file as an image? Thanks, Elizabeth

    I found my answer in message
    http://apex.oracle.com/pls/otn/f?p=11933:120:3919935161915118::NO:RP::.
    I used the <embed src=>
    Elizabeth

  • Where should the Green Tick get displayed in digitally signed pdf files in whom the Signature has been validated ?

    I have Windows 7 & Adobe 11 installed on my P.C (Apart from other Software) . Recently I downloaded Digitally Signed .pdf files & validated the Signature with Trust Certificates . However , the Green Tick Mark is coming on the left-hand side of a blue panel situated in-between the menu bar & the document . Shouldn't it be coming at the bottom right side of the document (Just above the name of the signatory) ? Is there anyway I can get the green tick to display at the bottom right side of the document or is this just the way the green tick gets displayed in current versions of adobe reader ?
    This is the way it gets displayed on the top - left portion of the screen :
    However , it does not get displayed in the below manner :

    First of all, you need an app on the iPad that can read those files that you want to transfer. Adobe Reader and iBooks are two free apps that will read PDF files. Adobe Reader is much more robust than iBooks as it offers so many more features like renaming files, creating folders, annotating, highlights, etc.
    Download Adobe Reader in the App Store. Then read this about file sharing with iTunes.
    iOS: About File Sharing - Support - Apple
    There are other ways to get files to the iPad, like email, DropBox and some other apps that let you mount your iPad like a flash drive.
    This should be helpful as well.
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad

  • Are the contents of PDF files indexed via O365?

    I have been testing PDF files on Office 365.  The content of the PDF files do not appear to be indexed .. as no search results are found using any of the terms within the PDF file.  I have seen documentation that indexing should be occurring, and
    lots of threads that it does not.
    So
    1. When I load PDF files, are the contents indexed (similar to how the iFilter works on on premise)?
    2. If not, any options? Any settings (can't find any), etc.
    Thanks
    jsk88

    You are going to provide some more information than that. Nobody here can begin to guess what files you are talking about, where you are experiencing this behavior, when you are experiencing this behavior, what you are doing when the contents disappear .......

  • Is it possible to display the content of a file in flex as it is written. E.G. a log file

    I have flex app sitting on a Linux server.
    I want to be able to spool the content of a file on the same server as the flex app to the users screen using say a textarea or similar.
    The file is some type of log so its going to constantly have lines added. Is there a way to do this ? I am guessing I need to constantly refresh the flex app with the file content.

    Yes you can. Small example for you:
    [email protected]> select * from dept;
    DEPTNO DNAME LOC
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    [email protected]> alter session set cursor_sharing=force;
    Session altered.
    [email protected]> alter session set events '10046 trace name context forever, level 12';
    Session altered.
    [email protected]> select * from dept where deptno = 20;
    DEPTNO DNAME LOC
    20 RESEARCH DALLAS
    [email protected]> exit
    Trace file:
    PARSING IN CURSOR #3 len=44 dep=0 uid=68 oct=3 lid=68 tim=110240041190 hv=3378028910 ad='7b0b0ca0'
    select * from dept where deptno = :"SYS_B_0"
    END OF STMT
    PARSE #3:c=0,e=28847,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=110240041185
    BINDS #3:
    bind 0: dty=2 mxl=22(02) mal=00 scl=00 pre=00 oacflg=10 oacfl2=100 size=24 offset=0
    bfp=06f04688 bln=22 avl=02 flg=09
    value=20
    EXEC #3:c=0,e=19767,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=110240071912
    WAIT #3: nam='SQL*Net message to client' ela= 5 p1=1111838976 p2=1 p3=0
    WAIT #3: nam='db file sequential read' ela= 13920 p1=23 p2=72274 p3=1
    FETCH #3:c=0,e=29325,p=1,cr=2,cu=0,mis=0,r=1,dep=0,og=4,tim=110240105613
    WAIT #3: nam='SQL*Net message from client' ela= 248 p1=1111838976 p2=1 p3=0
    FETCH #3:c=0,e=2,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=110240111496
    WAIT #3: nam='SQL*Net message to client' ela= 2 p1=1111838976 p2=1 p3=0
    WAIT #3: nam='SQL*Net message from client' ela= 1361188 p1=1111838976 p2=1 p3=0
    The interesting line for you
    BINDS #3:
    bind 0: dty=2 mxl=22(02) mal=00 scl=00 pre=00 oacflg=10 oacfl2=100 size=24 offset=0
    bfp=06f04688 bln=22 avl=02 flg=09
    value=20
    Which shows you that :"SYS_B_0" was subsituted with value equal 20
    Best Regards
    Krystian Zieja / mob

  • Mail will NOT display a multi-page pdf file in the body.

    I want to send an email with a multi-page PDF attached that is displayed in the email- so that readers don't even have to click on the pdf to open it. Can I do that? I can do a single page, and I did determine that if I save all the pages of the document as single pds and then attach those, that works, but is there a way to display a multi-page pdf? Any help would be greatly appreciated!

    I do not use pages - there are several possible solutions to your situation - in pages you should be able to do a send pdf to iPhoto and then in iPhoto you can create an e-mail with smaller (and harder to read) images- you may be able to produce smaller (lower quality) PDFs in pages (don't know), you can change e-mail servers - use a different one it you have multiple accounts or get a free gmail account or other new account that will handle your needs
    LN

Maybe you are looking for

  • Media Center Problems

    I have a sr5413wm with many upgrades and one of them was a sabrent tv card sbt-tvfm and when i use media center on vista home premium 32 bit the sounds and speech are off by about 5 seconds. And i have the latest and only driver for the card and i be

  • How can i active my multimedia and packet data?

    pls help of how to ative my multimedia and packet data, or wat the instractions i need to follow in order for me to active the multimedia model of the phone is 6070.hope u will help me in this .coz i want to share pics in my frnds and send a email to

  • Quicktime format to IMovie

    We bought a machine that easily captures our videos from camera to DVD, It plays back in Quicktime but will not import into IMovie for editing. Any suggestions?

  • Adding an x64 printer driver to samba

    Hello I try to add x64 print driver to samba server from Windows 7 x64 computer.  I use print management as described here https://wiki.samba.org/index.php/Configuring_Point_n_Click_Automatic_Printer_Driver_Deployment . Adding printer fails with 0x00

  • Spinning preloader wheel at the start of a slide

    Hi, I saw a similar topic on the forum but not sure it was answered. A colleague is doing a project where he records a slide with video playing. Captivate (v6) appears to save the video as an separte object on the slide layer of the timeline.  The pr