Displaying a pdf stored as a blob

I have a procedure which extracts a pdf from a blob, I would like to display this in a similar fashion as:
<img src="#OWNER#.PKS_NEWSTUDENTS.picture?p_id=#DOC_ID#"height=120/>
so that I can have it open up via a btton. How can I do this?
Edited by: Ed Siegle on Jun 25, 2010 2:19 PM

The sticking point was that I did not have public granted to my procedure. After doing that and placing the following in the URL this worked. This also does not display url path when hovered over by the mouse.
"#OWNER#.download_file?p_file=#ID#" onClick="popup = window.open('#OWNER#.download_file?p_file=#ID#','PopupPage','height=700,width=900,scrollbars=yes, resizable=yes'); return false" target="_blank" onmouseover="window.status='Select view Statement'; return true" onMouseOut="window.status=''; return true"onfocus="window.status='Select view Statement'; return true" onBlur="window.status=''; return true"

Similar Messages

  • How do you Display a PDF stored as a BLOB in Apex?

    We are trying to use Apex for the first time here in our shop. The project we have selected has PDFs stored on the database as BLOBS that we currently are able to display with our forms application. We want to do this using apex, and have them appear on one of the pages in the application. I want the PDF to display on the page, when the page itself is invoked, without the need to click on a download link on the page itself.
    I've seen certain examples displaying images etc, but I haven't found one that specifically refers to the display of a PDF database BLOB on a page (I assuming a report page) within Apex.
    Also, since I've just set up the Apex environment utilizing Oracle HTTP Server in the middle tier, do I need Oracle's BI Publisher in order to display the PDFs in Apex?
    Thanks in advance. Any advice or links would be much appreciated.
    Phil

    Thanks for the quick response, and you are correct. I've seen examples that include a link to specifically display the PDF, but I don't want them to be able to directly go to the PDF outside the context of the page itself. These are letters of recommendation that we store on our DB, and this application, for our med school admissions screeners, will be looking at up to three letters of recommendation for each applicant to which they have been assigned. We want them to click on an applicant, and then through a series of tabs view data on that applicant, some of which will be his/her letters of recommendation.
    Phil

  • Can I display a PDF stored in a table on a standard screen

    I have a requirement to allow a user to be able to review a returned Adobe Interactive Form before approving the form to be process and posted to FI.
    I am looking to save the returned form in a ztable and then later display the form on a screen with buttons to approve or reject.
    Is this possible without using a web dynpro?
    Every solution I track down seems to fill 80% of my needs.
    Suggestions?

    I don't know if it will meet your requirement or not, but you can use the HTML control to display a PDF document (the Adobe plug in should happen automagically for you) - then you could have additional buttons on that screen for the actions to be performed.
    To try it out, run report SAPHTML_DEMO1 (or go in via the Tcode DWDM Controls Demo) and simply paste in the directory and file name to be displayed e.g. "c:\data\demo_po.pdf" or whatever your PDF is called.
    Jonathan

  • Display a PDF in a region

    Hi. I have a pdf file stored in a database field as a blob, and I would like to display it as an image in a region.
    Anyone knows or have an idea on how to do it?
    Regards
    Jeannine

    Take a look at this link, it should help:
    Re: Displaying a pdf stored as a blob
    Sam

  • [XSQL] Displaying PDF stored in database as BLOB

    Dear Sirs,
    we have PDF stored in the database as BLOB.
    I have written a PLSQL function which I call accordingly
    <xsql:ref-cursor-function >
    digitallibrary.getdocs('{@resource_seqid}')
    </xsql:ref-cursor-function>
    however what I get is the following
    <page>
    <rowset>
    <row num="1">
    <document>255044462D312E320A...</document>
    </row>
    </rowset>
    </page>
    instead of having the customer's browser starting up Acrobat.
    It looks to me as if the data is the HEX of the BLOB:
    25 %
    50 P
    44 D
    46 F
    2D -
    31 1
    2E .
    32 2
    0A Line Feed
    This coincides with what previously reported
    "BLOB data is serialized as hex bytes in XSU."
    I understand that "XSQL has no built-in support for BLOB data, but it is extensible via user-written action handlers or user-written serializers."
    I have the feeling that I should use an appropriate serializer for this purpose but it is not entirely clear to me how ...
    Any suggestion is appreciated.
    Looking forward your advice.
    Regards and thanks
    Luca

    The following serializer
    public void serialize(Document document, XSQLPageRequest xsqlpagerequest) throws java.lang.Throwable {
    NodeList nodelist=document.getElementsByTagName("*");
    xsqlpagerequest.setContentType("application/pdf");
    OutputStream outputstream=xsqlpagerequest.getOutputStream();
    String DocString = new String();
    for (int loopIndex=0; loopIndex<=10; loopIndex++) {
    display(nodelist.item(loopIndex),"");
    if (loopIndex == 6 ) { DocString=displayStrings[loopIndex];}
    byte abyte0[] = oracle.xml.sql.core.OracleXMLConvert.convertHexStringToByte(DocString);
    outputstream.write(abyte0, 0, abyte0.length);
    outputstream.flush();
    works fine however the Internet Explorer 5.5 displays the native PDF code instead of firing the plugin... any suggestion ?

  • Problem displaying PDF stored in BLOB column

    Hello everyone.
    I've been trying to follow this tutorial http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::p11_question_id:232814159006 on displaying PDFs stored in BLOB columns. This is being performed on Apex 4.2, with my DB running 11g. I've got my procedure, which I'll post below:
    create or replace procedure "PDF" (p_id IN gvo_documents.doc_id%type)
    is
        l_lob    blob;
        l_amt    number default 30;
        l_off   number default 1;
        l_raw   raw(4096);
    begin
        select contents into l_lob
            from gvo_documents
             where doc_id = p_id;
    -- make sure to change this for your type!
        owa_util.mime_header( 'application/pdf' );
        begin
            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;
    end;
    I am trying to run this through a PL/SQL dynamic region and while I don't receive any error's, the content displayed is a huge mess of garbled text and odd characters. I've tried to run this procedure on numerous other document types, including word files and jpeg images, all with the necessary changes in my procedure, and regardless of what I use, I still get a large mess of strange characters. Does anyone have any information or ideas about why this is happening?

    If I understand correctly, your requirements needs to be broken down into two problems:
    1) click link that pops up a window displaying a new APEX page
    2) an APEX page the displays the document, not downloads it.
    I haven't done #1 (yet).
    However, you may be able to generate a URL that points to the new page as part of the SELECT statement for the Report.
    This has a related question, but no answer yet:
    open pdf in popup browser window
    The key is target="_blank" for the anchor tag.
    To generate the URL, you should use the APEX_UTIL.prepare_URL() function.
    If that doesn't work, a Dynamic Action that does some magical JavaScript stuff may be needed.
    For #2, I lost the URL that showed how to display a PDF as part of a "form" page.
    From what I remember:
    Start with a blank page with one blank HTML region (all the Items go in the HTML region)
    Add an Item for the PK/Doc_ID
    part I forgot Create a Data Manipulation Process
    - Automated Row Fetch
    - On Load - After Header
    - (stuff for your table/view)
    part I forgot Create an (I believe) "File Browser" item type. For Settings:
    - Storage Type "BLOB column specified in Item Source" (and place the column name of the BLOB there)
    - MIME Type Column: (column name) -- since you have multiple types, this is a MUST HAVE
    - Filename Column: (column name) -- I highly recommend you have this.
    - Content Disposition == INLINE <-- this is the kicker
    Also, you will need a Browser Plugin for each of the MIME Types (otherwise, the browser may try to 'download' the file)
    Browsers can handle Image types internally. Adobe's plugin can handle PDFs. I don't know about Word/Excel.
    Again, I don't remember the exact details, but that should cover most of it.
    MK

  • Report with a Download link for a Pdf stored in Blob in database FND tables

    We attach a pdf file in the Receivables invoices in Oracle EBS. We use APEX to report from EBS tables. We have a requirement to have a APEX report to display the pdf attached to the invoices with a capability to download the pdf. These pdf are stored in a blob column in fnd_lobs table.
    Any pointers on how to approach is highly appreciated.
    Thanks
    Jo

    check this How to Upload and Download Files in an Application
    let me know if you have any doubts

  • CANNOT DISPLAY A WORD/EXCEL DOC IN BLOB FIELD INTO A PDF REPORT

    We created a report that should display several kinds of documents at one time.
    These documents are stored in BLOB columns in database. We had no problem to
    display txt, gif or jpeg, but we could not display doc, xls, pdf or html
    documents.
    In this report we set three different fields in which display different kinds
    of documents depending on mimetype. The first field has FileFormat property set
    to 'Text' in order to display 'text/plain' and 'text/html' mimetype documents.
    The second field has it set to 'Image', which allow to display 'image/bmp',
    'image/gif', 'image/x-png', 'image/pjpeg' mimetypes. The third field has this
    property set to 'OLE2', and here is where we would like to display other
    mimetype documents as 'application/msword', 'application/vnd.ms-excel',
    'application/pdf'.
    We run the report on the web using:
    http://<server>:<port>/dev60cgi/rwcgi60
    ?server=<report_server>
    &report=<rdf_name>
    &destype=localfile
    &desname=<report_name.pdf>
    &userid=<user>/<password>@orcl9i
    &desformat=pdf
    <6meters>
    I have already read a lot of notes in Metalink but I could not find any
    solution. Is there any way to display a Word/Excel document from database in a
    report?
    We tried to convert Word/Excel docs to html format, but when we tried to
    display an HTML document in the report, we found that Oracle Reports displays
    the source code instead of the HTML format document. So, this did not work.
    What can we do?
    We also read somewhere that a possible solution would be to convert Word/Excel
    documents to a common format like GIF, JEPD or PDF. If processed as gif or jped
    the file could be displayed in the report. If processed as pdf the document
    could be linked in the report.
    I tried to display a PDF in the report but a blank box is displayed. How can I
    do this too?
    Any solutions?

    Hi,
    I have the same problem. I need to show up a BLOB, word file(.doc), in a custom report. I made a simple query, extracting file_date( the column having the blog (.doc) file) from the database, in the report and placed it on a layout by assigning it to a field "F_1". I addressed the file format as OLE2.
    But when I run the Report in APPS, it shows up an error "REP-1814: Report cannot be formatted. Object 'horizontally and vertically' can never fit within 'F_1'.". I also played with the layout by changing its size but the response had no change.
    I am using Reports6i and the output format of the report is PDF. Is there a way to resolve the issue? Please share the solution if you have any for this.

  • Display a PDF from a BLOB Column on a page.

    Hi Folks.
    I have PDFs stored in BLOB columns in the database.
    Is there a way to display these to the APEX user on the page at runtime?
    Any pointers appreciated.
    Meantime I'm going to experiment.
    Cheers
    Dogfighter.

    I suppose this depends really on what you want.
    You have at least two choices.
    1) Allow the user to download the pdf and then they get the option to save it or open it in a new window
    2) You can also get them to open it. You can open it in a new window by adding "_blank"
    in the target.
    The sample application has procedures download_my_file and custom_image_display which will show you how to achieve this.
    The only other way you could possibly do it is open it as a plugin. Thats way beyond my knowledge, but I'm sure someone else will chip in.

  • Is it possible to pass PDF (stored as BLOB) to PDFDocMerger

    HI Folks.
    Will PDFDocMerger Class allow you to pass in multiple PDF BLOBs as an input Stream Array?
    Any pointers appreciated as I need to know if this is a non-starter.
    I have many invoice PDFs stored as BLOBs in my database. I need a user to be able to select a bunch of these and have BIP merge them into one document.
    Any help greatly appreciated.
    Many thanks
    Dogfighter

    Hello Ike.
    I have downloaded the IDE and I am following the installation steps.
    I have performed step 3 and I have the following questions.
    1) I can see a node in JDeveloper called XMLPublisherDataTemplate.java but not one named format template. Should I be able to? Also, could not find this in the IDE download folders. Where should I be looking.
    2) I have executed the 'Run' on the XMLPublisherUtility.java node. The result was...
    \j2sdk1.4.2_13\bin\java.exe -jar D:\NGC IT\Software\Oracle\Java Developer\jdev\lib\ojc.jar -source 1.3 -target 1.2 -noquiet -warn -nowarn:320 -nowarn:486 -nowarn:487 -deprecation:self -nowarn:560 -nowarn:704 -nowarn:489 -nowarn:415 -nowarn:909 -nowarn:412 -nowarn:414 -nowarn:561 -nowarn:376 -nowarn:371 -nowarn:558 -nowarn:375 -nowarn:413 -nowarn:377 -nowarn:372 -nowarn:557 -nowarn:556 -nowarn:559 -encoding Cp1252 -g -d C:\BIPublisherIDE\BIPublisherIDE\classes -make C:\BIPublisherIDE\BIPublisherIDE\classes\BIPublisherIDE.cdi -classpath "\j2sdk1.4.2_13\jre\lib\rt.jar;\j2sdk1.4.2_13\jre\lib\i18n.jar;\j2sdk1.4.2_13\jre\lib\sunrsasign.jar;\j2sdk1.4.2_13\jre\lib\jsse.jar;\j2sdk1.4.2_13\jre\lib\jce.jar;\j2sdk1.4.2_13\jre\lib\charsets.jar;\j2sdk1.4.2_13\jre\classes;C:\BIPublisherIDE\BIPublisherIDE\classes;C:\BIPublisherIDE\BIPublisherIDE\lib\collections.jar;C:\BIPublisherIDE\BIPublisherIDE\lib\i18nAPI_v3.jar;C:\BIPublisherIDE\BIPublisherIDE\lib\j5472959_xdo.zip;C:\BIPublisherIDE\BIPublisherIDE\lib\jdom.jar;C:\BIPublisherIDE\BIPublisherIDE\lib\versioninfo.jar;C:\BIPublisherIDE\BIPublisherIDE\lib\xdochartstyles.jar;C:\BIPublisherIDE\BIPublisherIDE\lib\xdoparser.jar;C:\BIPublisherIDE\BIPublisherIDE\lib\xmlparserv2-904.jar;D:\NGC IT\Software\Oracle\Java Developer\jdbc\lib\ojdbc14dms.jar;D:\NGC IT\Software\Oracle\Java Developer\jdbc\lib\orai18n.jar;D:\NGC IT\Software\Oracle\Java Developer\jdbc\lib\ocrs12.jar;D:\NGC IT\Software\Oracle\Java Developer\diagnostics\lib\ojdl.jar;D:\NGC IT\Software\Oracle\Java Developer\lib\dms.jar;D:\NGC IT\Software\Oracle\Java Developer\j2ee\home\lib\activation.jar;D:\NGC IT\Software\Oracle\Java Developer\j2ee\home\lib\ejb.jar;D:\NGC IT\Software\Oracle\Java Developer\j2ee\home\lib\jms.jar;D:\NGC IT\Software\Oracle\Java Developer\j2ee\home\lib\jta.jar;D:\NGC IT\Software\Oracle\Java Developer\j2ee\home\lib\mail.jar;D:\NGC IT\Software\Oracle\Java Developer\j2ee\home\lib\servlet.jar" -sourcepath C:\BIPublisherIDE\BIPublisherIDE\src;\j2sdk1.4.2_13\src.zip C:\BIPublisherIDE\BIPublisherIDE\src\bipublisher\api\XMLPublisherApi.java C:\BIPublisherIDE\BIPublisherIDE\src\bipublisher\api\XMLPublisherDataTemplate.java C:\BIPublisherIDE\BIPublisherIDE\src\bipublisher\api\XMLPublisherDelivery.java C:\BIPublisherIDE\BIPublisherIDE\src\bipublisher\config\XMLPublisherConfig.java C:\BIPublisherIDE\BIPublisherIDE\src\bipublisher\utility\XMLPublisherUtility.java
    Error: cannot read: java.lang.Object
    [11:07:06] Successful compilation: 0 errors, 0 warnings.
    Can you suggest why I get "Error: cannot read: java.lang.Object"
    Many thanks
    Simon

  • Display PDF stored in database

    A page has a region of type “PL/SQL Procedure (anonymous block)” and the following region source:
    BEGIN
    get_image(3660);
    END;
    The code for the Get_Image procedure is shown below. This procedure extracts PDF images from a BLOB column in the database.
    When the page is executed, a popup window with the title “File Download” appears and the user is asked whether to open or save the file. If the user chooses to open the file, another popup window appears in which the user is asked to select the program to be used to open the file. If the user selects Acrobat Reader, the PDF image is displayed correctly. How can the image be displayed without any user intervention?
    The get_image procedure is as follows:
    PROCEDURE get_image (id_in IN NUMBER) IS
    vblob BLOB;
    buf RAW(32000);
    buf_size INTEGER := 32000;
    offset INTEGER := 1;
    len NUMBER;
    mime_type VARCHAR2(30);
    BEGIN
    -- get image_data and its mime type from the database
    SELECT image,image_type
    INTO vblob,mime_type
    FROM payslip_archive_local
    WHERE id=id_in;
    owa_util.mime_header(mime_type, false);
    owa_util.http_header_close;
    wpg_docload.download_file(vblob);
    -- set the mime type for the http protocol
    owa_util.mime_header(mime_type);
    -- read the data with htp package
    len:=dbms_lob.getlength(vblob);
    WHILE offset < len
    LOOP
    dbms_lob.read(vblob,buf_size,offset,buf);
    htp.prn(utl_raw.cast_to_varchar2(buf));
    offset:=offset+buf_size;
    END LOOP;
    -- check for exception
    EXCEPTION
    WHEN OTHERS THEN
    htp.p(SQLCODE || SQLERRM);
    END get_image;
    Vincent

    Hi,
    Forms can only show binary formats that are wrapped as OLE components and we discourage using this because OLE wont work on teh web, which is the only runtime available for Forms 9i and above.
    I suggest writing a Java Servlet that streams the document from the database to the local client
    Frank

  • Cache of Displayed Images Stored in a BLOB

    I would like to know how I can cache the data that is an image stored as a blob? This is for when I refresh/revisit/branch to a page taht contains images sourced from a blob, such that it does not compel the browser to regenerate the blob image file data?

    Hi!
    We use jsp (for example ManagerPhoto.jsp), which is deployed to OC4J:
    Blob managerPhoto;
    response.reset();
    response.setHeader("Content-Disposition", "attachment; filename=manager_photo.jpg");
    response.setHeader("cache-control","public");
    ServletOutputStream outputStream = response.getOutputStream();
    outputStream.write(managerPhoto.getBytes(1, (int)managerPhoto.length()));
    out.clear();
    out = pageContext.pushBody();
    And HTML-code in the page to display an image:
    <img width=120 height=149 src=".../ManagerPhoto.jsp?p_orun_id=11">
    Regards,
    Al.

  • How can I open a PDF stored in IXOS and then display it in a BSP

    Hello gurus,
    I have created a PDF icon and an onclick action to open a pdf, that displays on every row of an assignment block in the actions column, but I do not know the technical process to determine how to get a PDF from the IXOS system from the line selected. (even if I know it depends on an ID attribute of that assignment block) I want to to call a transaction launcher with the url for the pdf in the IXOS that has an ID that identifies which line in the assignment block the user has clicked the pdf icon for (does that make sense?)
    Therefore, I am assuming the PDF should correspond to the relance ID of the row in the assignment block, but I would like more information as per the business logic involved in able to achieve the desired results for this particular specification. I already confirmed that the XURL or any other attribute in the BOL object does not contain the URL to use for this. I have looked at the class I was told that it may contain the required business logic for determining which PDF in IXOS to fetch for a particular row, and I am currently trying to reverse engineer the logic through looking at other code and using the debugger, but so far I haven'T had much luck.
    Here are some questions I have now for the functional side in the meantime:
    1) Can we fetch the PDF in IXOS for each line of an assignment block?
    2) Which URL should I call with the transaction launcher? a URL link to the PDF on the IXOS system??
    3) Do we have to configure a transaction in the IMG to be launched?
    4) Do we have to create a logical link there that I will make dynamic to call the right PDF for each table line? 
    5) Are there any existing examples of this or a similar functionality/ logic that I could refer to, preferably in CRM 7 WebUI?
    6) Do you have any code to just display a PDF in a new window? Or prompt a download?
    One possible way I thought of would be for me to have a logical link defined in the IMG, that I could call passing it different attributes (eg. some object id, etc) and then return the PDF and display it in the UI in a new browser window by itself. Alternatively, we can just prompt a download. What do you think would be the optimal behaviour here?
    Please do not hesitate to propose any potential solution. Any partial answers/ links to wikis/ other threads, anything would be much appreciated.
    Thank you in advance.
    Best regards,
    Jonathan Laplante

    Hi,
    I partially answered your question in another posting but I feel that you´re in the wrong forum for your problem. This is for BSP development and you talk about CRM.

  • Display in "Oracle Forms 10g" a BLOB item

    Hey, anybody know if there was any java component or a way to display in "Oracle Forms 10g" a BLOB item, which contains no images, but files of type PDF, DOC, TXT ....
    Thank you

    <p>The Enhanced HTML browser bean allows showing amost everything in its window. See this screen shot</p>
    So you could download your stored document onto the AS or the client with the Webutil FILE_TRANSFERT package, or you could envisage top develop
    a nice PL/SQL procedure that would send the content via the UTL_HTTP package.
    Francois

  • Display word/pdf document in the HTML region or report

    Hi,
    How to display blob content stored in a table in HTML region or report region.
    I already have a process to display the image content.
    But my question here is how to display word/pdf document within the html region so that the user can read the document without downloading it.
    Any suggestions/solutions would be of great help.
    Thanks in advance...
    Thanks,
    Ramesh P.

    I was dead wrong.
    The display of images from BLOB is a special case because APEX provides a Display Image item type.
    Moreover, HTP/HTF packages also do not provide for handling of BLOB content. So AJAX cannot be used.
    Which implies that the only way to get binary content, other than images, is with the use of a WPG_DOCLOAD.DOWNLOAD_FILE call.
    This in turn implies that it may not be feasible to "inject" the BLOB into an exist HTML DOM in the Browser.
    Regards,

Maybe you are looking for

  • Help on how to fix macbook pro 13inch 2010 (cpu 1 caller 0x47f5ad)?

    help on how to fix macbook pro 13inch 2010 Hi, I need some peoples help on fixing my laptop. I have a macbook pro 13 inch 2010 model, and it refuses to boot into either osx or windows. Every time I prevoiusly treid to boot into mac osx I got this err

  • Apple Software Update 2.1.3

    Looked for a definitive answer but found none. I'm a Mac user who has to run Windows 7 under Parallels for a  non-Apple program I need for my work. It all runs like clockwork (well, better, as it doesn't need winding up). Like many other people, I've

  • BI Publisher Desktop Cannot Log In

    Getting the following error when attempting to log into BI Publisher Desktop: "Please contact administrator for your userid/password" Current Installation specs: Windows 7 SP 1 64 bit , Office Professional Plus 2010 32 bit, Word V 14.0.7106.5003, BI

  • Just bought a new IPad mini and trying to transfer game center files from Ipod.  How do I do this?

    Just bought a new IPad mini and trying to transfer game center files from Ipod.  How do I do this without losing level progress?

  • Purposefully "do not preserve current users ..."

    If I do an Archive and Install and elect to not preserve my current users, will my applications folder be bare of any third-party applications? I have done Archive and Installs (with perserving current users) and all my applications stay in the Appli