Skip to content

grlicaa/GEN_PDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GEN_PDF

Demo

A demo application is available on apex.oracle.com
https://apex.oracle.com/pls/apex/f?p=89938

Changelog

V 1.0.

  • Release date : 14/10/2015

About

GEN_PDF is PL/SQL based generator for PDF.

GEN_PDF is mix of WPDF(1.4.8b) and AS_PDF3.

Why ?

  • WPDF is great for setting position of custom tables, colors, borders ...
  • AS_PDF3 is great for importing fonts into PDF

GEN_PDF is set to work on apex. Fonts and images are stored in WWV_FLOW_FILES or CUSTOM table, so there is no need to use UTL.FILE package (like in AS_PDF3) and there is also no need for "ordsys.ordImage" (like in PL_FPDF which don't work on XE db).

You can find more info inside "GEN_PDF.pks"

How to use it

Inside package are few samples which demonstrate almost all functionality of GEN_PDF tool.

List of samples inside package :

  • procedure emp_demo
  • procedure fonts_demo
  • procedure barcode_demo
  • procedure rotate_demo
  • procedure images_demo
  • procedure testHeader
  • procedure chart_demo

Run sample:

Add apex Non-Modal dialog page and before header in process add PL/SQL code

BEGIN
  gen_pdf.emp_demo();
  apex_application.stop_apex_engine;
END;

Needed Rights

For last sample "chart_demo" to work you need :

  1. Grant on UTL_HTTP
  GRANT EXECUTE ON UTL_HTTP TO <USER>;
  1. ACL permissions to get Google chart and QR code
     BEGIN
        DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
            acl          => 'chart.xml',
            description  => 'Permissions to get chart image',
            principal    => 'APEX_050000', -- APEX_SCHEMA depands on APEX version
            is_grant     => TRUE,
            privilege    => 'connect');
        COMMIT;
     END;
     /
     BEGIN
        DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
            acl          => 'chart.xml',
            host         => 'chart.googleapis.com');
        COMMIT;
        END;
     /
     BEGIN
        DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
            acl          => 'chart.xml',
            host         => 'zxing.org');
        COMMIT;
     END;
     /

In case you need to save file on server you can enable procedure "save_pdf".

If you need reed file from server "font or pdf" than enable function "file2blob".

For this to work you need grant on UTL_FILE.

  GRANT EXECUTE ON UTL_FILE TO <USER>;

About me

Andrej Grlica
I’m a oracle apex developer since 2008.
Work email : andrej.grlica@right-thing.solutions
Private email : andrej.grlica@gmail.com
Twitter : @AndrejGrlica
Linked-in : Link
Slack (#orclapex) PM:@grlicaa