0
votes

I'm using oracle apex 5.1 and I'm storing a pdf into a blob column into a database table; I would like to extract that blob column into apex and be able to preview it on a apex form/ region. I know you can download a pdf, but I just want to preview without having to download in pdf format. Would you somehow try to store the blob content into APEX_APPLICATION_TEMP_FILES for displaying purposes?

1

1 Answers

1
votes

I'm not sure copying the blob to a built-in APEX table would make this any easier.

But I think this should be feasible. There are two parts you need to work out: (a) turning the blob into a URL that you can use to download or view the PDF directly, and (b) embedding the PDF on an APEX page using that URL.

For the first part, see this excellent post for an example of how to generate a download link for a blob in APEX. There are a ton of other solutions out there, but this one is very clean and easy to use.

For the second part, see this question about how to embed a PDF in a web page, or this other one. Whether you want to go with <object>/<embed> tags or a JavaScript library will probably depend on your environment and what browsers you want to support.