PL/MERGE — PDF Merging for Oracle Applications

Combine existing PDF documents stored as Oracle BLOBs into one merged PDF directly from PL/SQL. PL/MERGE imports complete pages with the resources they need to render correctly while keeping the first PDF as the master document.

Merge PDFs where your Oracle data already lives

PL/MERGE is designed for Oracle applications that already create, receive or store PDF documents as BLOBs. It combines complete PDF documents without requiring them to have been generated by PL/PDF or any other specific PDF software.

Oracle BLOB in, BLOB out

Pass existing PDF documents as Oracle BLOBs and receive a new caller-owned BLOB containing the merged PDF.

Complete-page import

PL/MERGE imports complete PDF pages together with the fonts, images, resources, annotations and other page-level objects required to render them correctly.

Generator-independent

Merge PDFs produced by PL/PDF or by other applications and systems. PL/MERGE operates on the PDF documents themselves, not on their original generation process.

Choose the merge API that matches your workflow

Use a single function for straightforward merges or a stateful builder when PDF documents arrive one at a time.

MERGE2

Merge exactly two PDF documents. The first PDF becomes the master and the second PDF is appended after it.

l_merged := pl_merge.merge2(
  p_pdf1 => l_pdf1,
  p_pdf2 => l_pdf2
);

MERGE

Merge a collection of PDF BLOBs in one call. Page order follows collection order and the first collection element is the master document.

l_merged :=
  pl_merge.merge(l_pdfs);

Stateful builder

Start with one master PDF, append source documents sequentially and perform one final save when the complete document is ready.

l_merge :=
  pl_merge.begin_merge(l_pdf1);

pl_merge.append(l_merge, l_pdf2);
pl_merge.append(l_merge, l_pdf3);

l_merged :=
  pl_merge.finish(l_merge);

Built for real PDF object graphs

A PDF page is more than a visible content stream. Fonts, images, graphics resources, annotations and shared objects can all be referenced indirectly throughout the document. PL/MERGE imports and remaps the page-level object graph required by each accepted source page.

Page geometry preserved

Inherited MediaBox, CropBox, Rotate and Resources values are normalized where required so imported pages remain self-contained in the new page tree.

Rendering resources remapped

Fonts, images and other XObjects, transparency groups, annotations and content streams are transferred with the page and remapped into the merged PDF.

Shared objects remain shared

Objects shared by multiple source pages remain shared after import instead of being cloned independently for every page.

A predictable master-document policy

The first PDF is deliberately treated as the master document. Later PDFs contribute their pages and required rendering dependencies rather than replacing document-level state unpredictably.

The master defines the document

  • Document Catalog
  • Info dictionary and XMP metadata
  • Names and named structures
  • Outlines and bookmarks
  • Page labels
  • Threads and retained viewer-level state

Appended PDFs contribute pages

All master pages appear first, followed by the pages from each appended PDF in source order. The effective output PDF version follows the highest effective version required by the inputs.

This deterministic policy makes it possible to choose deliberately which PDF supplies the metadata, bookmarks and other retained document-level structures.

Designed for controlled Oracle workflows

One final full save

PL/MERGE builds the complete merged document and performs one final full PDF rewrite. Collection and builder workflows do not repeatedly serialize the growing output after every appended source.

Explicit BLOB ownership

Input BLOBs remain caller-owned. The merged result is returned as a separate caller-owned BLOB, giving the application explicit control over persistence and temporary LOB cleanup.

Sequential source processing

With the builder API, each appended source is detached into the target before APPEND returns successfully, so the application can release that source BLOB before loading the next document.

Merge first. Secure the final PDF afterwards.

PL/MERGE performs a full rewrite, so encrypted and already signed input PDFs are intentionally rejected. Merge the unsigned source documents first, then apply encryption or a final digital signature to the completed PDF.

For standards-based PAdES digital signatures and trusted timestamps, use PL/SIGN after the merge operation.

Clear scope for predictable PDF processing

PL/MERGE focuses on combining complete PDF documents and deliberately rejects structures that cannot be preserved safely by the current merge policy.

Supported processing

  • Complete PDF document merging
  • Classic cross-reference tables
  • Cross-reference streams
  • Object streams
  • Multiple PDF versions
  • Stream or array-based page contents
  • Fonts, images, annotations and shared page resources
  • Tagged appended PDFs as visual pages with structural tagging removed

Current exclusions

  • Encrypted input PDFs
  • Digitally signed input PDFs
  • AcroForm documents
  • Tagged master PDFs
  • Page selection or page reordering within a source
  • PDF content editing
  • Form-field merging
  • Tagged-PDF structure-tree merging

PDF merging for real Oracle business workflows

Use PL/MERGE wherever an Oracle application needs to combine existing PDF documents before storage, delivery, archiving or final signing.

Invoices and reminders

Combine a generated reminder or cover document with the related invoice PDFs stored in Oracle.

Document packages

Assemble multiple application-generated or externally received documents into one distributable PDF.

Final signing workflows

Build the complete PDF first, then pass the merged result into the final security or digital-signature stage.

Try PL/MERGE

Request access to a hosted sandbox, or evaluate PL/MERGE in your own Oracle environment with an install kit and a 31-day evaluation key.

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.