Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PDF blob: can we get the page count using pl/sql only? [db 19c / apex 24.1]

HoekJan 11 2025

Hi all,

(This question has been asked before, however, on older db/apex versions and times change every new version, so I thought I'd give it a shot, maybe there are solutions now that I'm not aware of)

The problem:
In order to avoid to have to change 4 systems, our ideal situation would be to be able to extract the page count from a blob column containing PDF files and store the page count. Depending on that further specific processing follows.

I've seen a few ways here to tackle this, the ‘ctx_doc.policy_filter-way’ looks promising.
( How to find number of pages of PDF file in BLOB column. - Oracle Forums )
( How to read/view a BLOB Column value(Word doc/PDF files content) without download in Oracle Apex Interactive\Classic Report? - Oracle Forums )

I also found this:
php - Get the number of pages in a PDF document - Stack Overflow
but I'm not a PHP-guy. But it sure seems possible to get the page count.

However, I don't see page count in the metadata. I'm no PDF expert, so I wonder:

  1. Is it possible that the page count isn't always available in the PDF file?

  2. Are there other ways to obtain the page count, using Oracle/APEX packages/pl/sql only?

  3. Why doesn't adobe just provide the metadata in a simple way? (this is not a serious question)

Many thanks in advance for clues/pointers/tips!
We're on db 19c / apex 24.1

Regards,
Hoek

This post has been answered by Anton Scheffer-Oracle on Jan 21 2025
Jump to Answer
Comments
Post Details
Added on Jan 11 2025
6 comments
431 views