Display PDF in Apex Region
Hi,
I have a requirement to view the PDF content in the apex page region, I am using Apex 3.2 and Oracle 10 Enterprise edition.
I Uploaded the PDF file in the shared component under static file. Now i need to view the content of the PDF file.
Please suggest me method to view the PDF content.
I saw the link in denes blog here he shows how the PDF is getting displayed. but there is no steps of methods mentioned
>>http://htmldb.oracle.com/pls/otn/f?p=31517:108:56351399589001:::::
Please suggest.
Thanks
Sudhir
Hi Sudhir,
when you look at page 3, region "pdf canvas" then you will see the code:
<canvas id="the-canvas" style="border:1px solid black"></canvas>
<!-- Use latest PDF.js build from Github -->
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>
<script type="text/javascript">
// NOTE:
// Modifying the URL below to another server will likely *NOT* work. Because of browser
// security restrictions, we have to use a file server with special headers
// (CORS) - most servers don't support cross-origin browser requests.
var url = '#WORKSPACE_IMAGES#Shilpa.pdf';
// Disable workers to avoid yet another cross-origin issue (workers need the URL of
// the script to be loaded, and dynamically loading a cross-origin script does
// not work)
PDFJS.disableWorker = true;
// Asynchronous download PDF as an ArrayBuffer
PDFJS.getDocument(url).then(function getPdfHelloWorld(pdf) {
// Fetch the first page
pdf.getPage(1).then(function getPageHelloWorld(page) {
var scale = 1.5;
var viewport = page.getViewport(scale);
// Prepare canvas using PDF page dimensions
var canvas = document.getElementById('the-canvas');
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;
// Render PDF page into canvas context
page.render({canvasContext: context, viewport: viewport});
</script>
There you can change the url, I actually already reference your workspace file in there.
But please give a list of browsers you are trying to support. It all depends on the specifics.
Cheers,
Dietmar.
Similar Messages
-
Hi,
I have a pdf document out on intranet site that I would like to have a APex report link to that document.
This is how I defined the page:
Page type - URL
region source - http://www.xxx.xxx/../xxx.pdf
It took a long time to bring up the pdf and the document is displayed in the wrong format. Has anyone done it before? How can I display pdf in APEX?
Thanks,
JulieHello Julie,
Here is how I handle making my user's reference manual available from my application. It is a PDF stored like yours.
1. Define item as: Display as Text (excape special characters, does not save state)
2. Make your Label something like this: <a href="[http://www.mydomain.com/.../.../.../document.pdf] target="_blank">System User Manual</a> (substitute your link info of course)
target="_blank" opens the document in a new window.
3. Set Horizontal/Vertical Alignment appropriately (I use Left).
4. Template: Optional Label
The remaining items do not matter.
The things now that will dictate how long to download the PDF are, network speed on your end, network speed on the recipient end, network load, size of the PDF and the other normal things that cause a download to be slow.
Hope this helps,
Don -
Display BLOB to PDF in a region
Hello,
I have this function :
getblobfile(APEX_WEB_SERVICE.PARSE_RESPONSE_CLOB('RESPONSE','//runReportReturn/reportBytes','xmlns="http://xmlns.oracle.com/oxp/service/PublicReportService"')
that return a CLOB converted to a BLOB. The BLOB contains a PDF.
I would like to display this PDF in a region (in Apex page). How can I do ?
Thanks.Take a look at this link, it should help:
Re: Displaying a pdf stored as a blob
Sam -
I am trying to grab a pdf from a blob column in a table and display it in a pl/sql dynamic region, with mixed results..
On the Oracle hosted instance of APEX, under the following credentials:
Workspace: Homeworld
User: Demo
Password: demo
I have an application called PDF Display Issue (# 74691). On page 2 of the app I upload a file (hopefully a PDF) to my table (APP_HELP). On page 3 I have a pl/sql Dynamic Region with the following code:
{code}
DECLARE
v_mime VARCHAR2 (48);
v_length NUMBER;
v_file_name VARCHAR2 (2000);
v_lob_content BLOB;
BEGIN
SELECT mime_type,
blob_content,
DBMS_LOB.getlength (blob_content)
INTO v_mime,
v_lob_content,
v_length
FROM APP_HELP;
OWA_UTIL.mime_header (NVL (v_mime, 'application/pdf'), FALSE);
HTP.p ('Content-length: ' || v_length);
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (v_lob_content);
END;
{code}
However when I run page 3, I get a jumbled mess of characters displayed to the screen versus the PDF that was uploaded earlier..
Usually I do PDF downloads via a report so I am wondering if the code I am using is not viable in APEX 4.x
If anyone can take a look and offer up a suggestion I would be appreciative...
Thank you,
Tony Miller
LuvMuffin Software
Ruckersville, VAHi,
Yes you can open popup window.
I did copy your sample page 4 to new ID. Just that I do not mess your examples.
Then added entry "Display PDF in popup" to your sample page 1 list.
That list entry url target is
javascript:apex.navigation.popup.url('f?p=&APP_ID.:5:&APP_SESSION.:::::');
Regards,
Jari -
Display PDF file in the Apex query report using HTML Expression
Hi Folks,
I have PDFs stored in BLOB columns along with FILE_ID column in the database.
I want to display these to the APEX user on the page at runtime.
I have created a SQL Query report page to display FILE_ID column.
I am using HTML Expression property of the FILE_ID column to pull the image from the table using PROC_DISPLAY_DOCUMENT procedure.
I typed folowing code int the HTML Expression text area of the FILE_ID column of the report page :
<img src="#OWNER#.proc_display_document?p_id=#file_id#"/>
I am using following Procedure code:
create or replace procedure "PROC_DISPLAY_DOCUMENT"(p_id number) as
s_mime_type varchar2(48);
n_length number;
s_filename varchar2(400);
lob_image blob;
Begin
select MIME_TYPE,dbms_lob.getlength(blob_content),file_name,blob_content
into s_mime_type,n_length,s_filename,lob_image
from tbl_upload_file
where file_id = p_id;
owa_util.mime_header(nvl(s_mime_type, 'application/octet' ),false);
--set the size so the browser knows how much it will be downloading
htp.p( 'content-length: '|| n_length );
--The file name will be used by the browser if the users does a "save as"
htp.p( 'content-Disposition: filename="' || s_filename ||'"');
owa_util.http_header_close;
--Download the BLOB
wpg_docload.download_file( lob_image );
exception
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-202121,'Record matching screenfield filename not found, PROC_DISPLAY_DOCUMENT.');
end;
--This is very Important
--grant execute on PROC_DISPLAY_DOCUMENT to public;
This code does not work and report does not display PDF image.
Any help to troubleshoot this code will be appreciated.
Thank you in advance.
JayaHi Dimitri,
I hope you can see HTML Expression code now. Thank You for responding.
I have PDFs stored in BLOB columns along with FILE_ID column in the database.
I want to display these to the APEX user on the page at runtime.
I have created a SQL Query report page to display FILE_ID column.
I am using HTML Expression property of the FILE_ID column to pull the image from the table using PROC_DISPLAY_DOCUMENT procedure.
I typed folowing code int the HTML Expression text area of the FILE_ID column of the report page :
[!-- img src="#OWNER#.proc_display_document?p_id=#file_id#" ]
I am using following Procedure code:
create or replace procedure "PROC_DISPLAY_DOCUMENT"(p_id number) **
mimetype varchar2(48);
n_length number;
s_filename varchar2(400);
lob_image blob;
Begin
select MIME_TYPE,dbms_lob.getlength(blob_content),file_name,blob_content
into s_mime_type,n_length,s_filename,lob_image
from tbl_upload_file
where file_id = p_id;
owa_util.mime_header(nvl(s_mime_type, 'application/octet' ),false);
--set the size so the browser knows how much it will be downloading
htp.p( 'content-length: '|| n_length );
--The file name will be used by the browser if the users does a "save as"
htp.p( 'content-Disposition: filename="' || s_filename ||'"');
owa_util.http_header_close;
--Download the BLOB
wpg_docload.download_file( lob_image );
exception
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-202121,'Record matching screenfield filename not found, PROC_DISPLAY_DOCUMENT.');
end;
--This is very Important
--grant execute on PROC_DISPLAY_DOCUMENT to public;
This code does not work and report does not display PDF image.
Any help to troubleshoot this code will be appreciated.
Thank you in advance.
Jaya -
Hi all,
I am using 10g xe with apex4
I need to display pdf on a page.
How can we do that...
thanks in advanceHi Jyothi,
This link might be helpful:
[url http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm] Defining and Viewing BLOB Data in Oracle Application Express 3.1
This is a link for Defining and Viewing BLOB Data in Oracle Application Express 3.1, but with little
modifications it is applicable for higher versions of APEX.
Hope it helps!
Regards,
Kiran -
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 -
Error while generating PDF from APEX through BI Publisher
Hi,
I am facing a problem which is intermittent.
I am generating a pdf from APEX which has been developed using BI Publisher.
I have linked the report to the APEX using report queries/report layouts in shared components.
The pdf used to open without any problems previously.But currently,I am getting the following error
*"An error exists on this page.Acrobat may not display the page correctly.Please contact the person who created the pdf document to correct the document."*
Once the Bi Publisher Services is restarted,I am able to generate the pdf.Again After sometime the same error pops up.
Has anybody faced the above error?
Any solution for the same.
Kindly reply.
Thanks and Regards,
K Tannain the log file,following message was shown
[050510_021134100][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) is called.
[050510_021134126][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) done. All inputs are cleared.
[050510_021134126][oracle.apps.xdo.template.FOProcessor][STATEMENT] End Memory: max=15744MB, total=237MB, free=121MB -
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
RamonMoving this discussion to the Adobe Reader forum.
-
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 -
Using htp.p for print dynamic data in apex region make my page slow?
Hi, everyone!!! My name is Rafael, and...
I search in the web and in this forum but i can´t find a answer for my doubt.
Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
Example:
For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
I notice that this practice causes slow to load the data on the page.
This is it...
If someone help me, thanks...
bye and Happy new Year!!!
Edited by: user9518141 on 26/12/2009 17:19Hi,
Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
I think the function call is probably taking a lot of time .. not htp.p.
I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
Thanks,
Rajesh. -
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 do I display more than one region as a modal popup?
Hello all!
I have a popup that displays a report region. I now want it to display more than one region, say a report region and another report region underneath it.
Here's the code that I currently have (and this one can popup one region):
$.fx.speeds._default = 1000;
$( function(){
$('#ModalForm').dialog(
modal: true,
autoOpen: false,
width: 650,
height: 450,
buttons:{ Calculate: function(){calculateTotal();},
Close: function(){closeForm();}
function openForm(pFoodTemplateId, pMealTypeId)
var getone = new htmldb_Get('shiny',&APP_ID.,"APPLICATION_PROCESS=DUMMY", &APP_PAGE_ID.); // initialize get
getone.add('P24_TEMPLATEID', pFoodTemplateId);
getone.add('P24_MEALID', pMealTypeId);
gReturn = getone.get();
getone = null;
$('#ModalForm').dialog('open');
function closeForm()
{$('#ModalForm').dialog('close');}
$(document).ready(function()
{$('a.temppop').click(function() {openForm();});
});The class of the button (or in my case, the link in another region that's not displayed as a popup) is temppop.
QUESTION:_
How do I edit my existing code, so that it can now display another region?
The ID of the region it displays now is ModalPopup. I would like to add another region, with another ID off course. Pick any ID, as long as you can explain to me how.Magali wrote:
Hello all!
I have a popup that displays a report region. I now want it to display more than one region, say a report region and another report region underneath it.
Here's the code that I currently have (and this one can popup one region):
$.fx.speeds._default = 1000;
$( function(){
$('#ModalForm').dialog(
modal: true,
autoOpen: false,
width: 650,
height: 450,
buttons:{ Calculate: function(){calculateTotal();},
Close: function(){closeForm();}
function openForm(pFoodTemplateId, pMealTypeId)
var getone = new htmldb_Get('shiny',&APP_ID.,"APPLICATION_PROCESS=DUMMY", &APP_PAGE_ID.); // initialize get
getone.add('P24_TEMPLATEID', pFoodTemplateId);
getone.add('P24_MEALID', pMealTypeId);
gReturn = getone.get();
getone = null;
$('#ModalForm').dialog('open');
function closeForm()
{$('#ModalForm').dialog('close');}
$(document).ready(function()
{$('a.temppop').click(function() {openForm();});
});The class of the button (or in my case, the link in another region that's not displayed as a popup) is temppop.
QUESTION:_
How do I edit my existing code, so that it can now display another region?
The ID of the region it displays now is ModalPopup. I would like to add another region, with another ID off course. Pick any ID, as long as you can explain to me how.First build your dialog for new ID (please replace NEWREGIONID with your region static id)
$( function(){
$('#NEWREGIONID').dialog(
modal: true,
autoOpen: false,
width: 650,
height: 450,
buttons:{ Calculate: function(){calculateTotal();},
Close: function(){closeForm();}
And now you could open or close the dialog
$('#NEWREGIONID').dialog('open'); -
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,
ArunYou 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. -
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.MProbably 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
-
How to pupup the calendar value into text box ?
Hi I want to use the calendar for my text field . The calendar will popup when I click a button /image. This image will appear next to text box . when click the calendar. The values should come to into text box. Please give me any idea how to write a
-
How can BW/SEM consultant transition to BPC
I am an experienced SAP BW/SEM-BPS consultant and have more than 10 engagement in this space. I went thru the outlooksoft admin I and II courses. Is this enough to break into BPC ?. Also looking at BPC 7 demo it looks like we need both BW and outlook
-
I bought a song and as it was downloading an error occured saying that it could be corrupt and could not be downloaded- to look at itunes stores for to check for avavilablity- I cant find where to do that=)
-
I installed Master Suite 6 a while ago. When Cleaning up my computer files today, I came across a Directory on the Desktop called Adobe CS6 Master Collection. Inside are 2 directories: Adobe CS6 - (which is 8GB and contains subdirectories Deploy, pa
-
Web Object Widget and replacing Variables in the URL
I am using the new Web Object Widget in Captivate 7 and need some help with setting up the URL for the widget correctly. If I hard-code a static web page address, the widget works fine. The problems comes up when I need to slightly change the tail-