From Oracle BLOB to the User: Delivering PDF, EPUB, DOCX and XLSX Documents

Generating a document is only part of the job.

PL/PDF and the PL/ components can generate PDF, EPUB, DOCX, XLSX and other document formats directly from Oracle data and PL/SQL. But once the document exists, the next question is just as important:

How do we show it, share it or deliver it?

In many Oracle applications, the generated file is stored as a BLOB in a database table. In other cases, the document is created and delivered immediately without long-term storage. Both models are valid, and both fit naturally into an Oracle-based architecture.

1. Store the document in Oracle

Storing the generated document in a BLOB column is often the most natural approach when the file belongs to a business record.

An invoice can stay connected to its customer and accounting entry. A certificate can stay linked to its owner. A report can remain associated with the process or transaction that created it.

This gives several advantages:

  • secure storage inside the database;
  • SQL-based retrieval;
  • integration with application metadata;
  • backup and recovery as part of the Oracle environment;
  • controlled access through the application.

In other words, the document becomes part of the business data model, not just a file somewhere on disk.

2. Show or download it in Oracle APEX

For interactive applications, Oracle APEX is usually the first delivery channel.

A PDF may be previewed directly in the browser, while PDF, EPUB, DOCX or XLSX files can be offered as authenticated downloads. The application remains in control of who may access which document, and the BLOB can stay in Oracle until the user requests it.

This is ideal for:

  • customer portals;
  • internal reporting applications;
  • document archives;
  • invoice and certificate download pages.

A common pattern is simple:

Oracle data → PL/SQL generation → BLOB → APEX preview or download

3. Send it as an email attachment

Sometimes the document should not wait for a user to log in. It should be delivered automatically.

For invoices, statements, confirmations or certificates, email is still one of the most practical channels. If the document already exists as a BLOB, it can be attached directly to an outbound email from Oracle.

In APEX-based environments, this is straightforward because the generated BLOB can be passed directly as an attachment. There is no need to write the file to the database server filesystem first.

This makes email a clean extension of the same PL/SQL workflow.

4. Deliver it through a REST or Web Service

Increasingly, documents are not delivered to people first, but to other systems.

A generated PDF or XLSX may need to be sent to:

  • a customer API;
  • a supplier platform;
  • a document management system;
  • an archive service;
  • an e-invoicing platform;
  • another enterprise backend.

In this case, the Oracle application can create the document and immediately send the BLOB through a REST or SOAP integration. The database remains the point where the business logic, the data and the document generation all meet.

This creates a very clean flow:

Oracle data → document generation → BLOB → web service delivery

5. Use eDelivery or a similar service for structured exchange

Some business scenarios require more than a simple API call or email.

For B2B or public-sector workflows, a document may need to pass through a more formal electronic delivery channel, such as an eDelivery or AS4-based service. In that case Oracle does not necessarily need to implement the whole delivery stack itself.

A practical model is that PL/SQL generates the document, then hands the BLOB to a delivery service provider or integration layer responsible for secure transport, routing and partner exchange.

This is particularly relevant when documents must be delivered in a regulated or interoperable business network.

One generation layer, multiple delivery channels

This is the key architectural idea.

The document generation layer does not need to know in advance whether the result will be:

  • stored in a table;
  • shown in APEX;
  • downloaded by the user;
  • sent as an email attachment;
  • uploaded through a REST API;
  • delivered through an eDelivery service.

As long as the result is handled as a BLOB, Oracle and PL/SQL remain in control.

That is why this approach works well with PL/PDF and the PL/ product family: documents are generated where the business data already lives, and from there they can be stored, shown or distributed through the channel that best fits the workflow.

Generate once. Deliver where needed. Keep the whole process close to the Oracle application.

#Oracle #PLSQL #OracleAPEX #PDF #EPUB #DOCX #XLSX #REST #eDelivery #EnterpriseIntegration

PLslash
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.