Skip to main content

Custom attributes

Component

All the plug-in region attributes available in the Oracle APEX page designer are listed and described below.

Settings

TypeRequiredDependent on
CheckboxNoNone

Use the following options to set the plug-in configuration.

Disable Annotations

CheckedNot Checked
Annotation tool is not availableAnnotation tool is available

Disable Shapes

CheckedNot Checked
Shapes tool is not availableShapes tool is available

Disable Insert

CheckedNot Checked
Insert tool is not availableInsert tool is available

Disable Edit

CheckedNot Checked
Edit tool is not availableEdit tool is available

Disable Forms

CheckedNot Checked
Forms tool is not availableForms tool is available

Disable Fill and Sign

CheckedNot Checked
Fill and sign tool is not availableFill and sign tool is available

Disable Measurement

CheckedNot Checked
Measurement tool is not availableMeasurement tool is available

Source

The attribute defines how PDF Region Pro maintains documents. Depending on the attribute value, there are different implementations.

Default Table

When selected, PDF Region Pro maintains documents using the UC_PDF_DEFAULT_FILES table.

The default table implementation supports built-in document versioning using the UC_PDF_DEFAULT_VERSIONS table. Versioning must be enabled using the PL/SQL variable UC_PDF_REGION_PRO in the Initialization PL/SQL Code attribute.

Custom Table

When selected, PDF Region Pro maintains documents using a table specification provided by a developer via the PDF Region Pro region attributes. A developer has to provide a table specification, including:

  • Table name
  • Primary key(s) column(s)
  • Column name for a document BLOB content
  • Column name for a document filename
  • Column name for a document MIME Type
  • Column name for a document's last modification time
  • Column name for a document's current version (optional)
  • Column name for a document owner

Custom PL/SQL

When selected, PDF Region Pro maintains documents using PL/SQL code provided by a developer. A developer has to create a package containing the required procedures for handling documents operations, such as:

  • UC_PDF_REGION_PRO.g_doc_getfileinfo - fetching a document meta-data

  • UC_PDF_REGION_PRO.g_doc_create- saving (creating) a new file based on an empty template BLOB of the requested type

  • UC_PDF_REGION_PRO.g_doc_update- updating a document

The package name has to be entered into the Custom PL/SQL Package Name attribute, and procedure names must be provided using variables in the Initialization PL/SQL Code attribute. *Learn more in Custom Attributes \ Initialization PL/SQL Code*

Table Name

TypeRequiredDependent on
TextYesSource \ Custom Table

A custom table name where documents are stored. The table name can be prefixed with #OWNER# to reference the current parsing schema, ie. #OWNER#.UC_PDF_DEFAULT_FILES.

A custom table must have (at least) the following types of columns:

DescriptionType
Column storing a document's primary keyVARCHAR2 | NUMBER
Column storing a document's filenameVARCHAR2
Column storing a document's owner (an application end-user username)VARCHAR2
Column storing a document's MIME-typeVARCHAR2
Column storing a document's current versionNUMBER
Column storing a document's contentBLOB
Column storing a document's last modification timeTIMESTAMP(6)
Multiple Primary Keys
A custom table can use multiple primary keys to identify a document. Comma-delimited column names must be set using the Primary Key(s) Column(s) attribute.

Primary Key(s) Column(s)

TypeRequiredDependent on
TextYesSource \ Custom Table

Specify a comma-delimited list of column names used as primary keys for a document in the custom table.

Item(s) Containing Primary Key(s) Value(s)

TypeRequiredDependent on
Page Item(s)YesNone

A given APEX page item(s) is (are) used to identify a document to load from the database table. When any APEX item specified as the primary key is set to NULL, the PDF Region Pro webviewer shows the document creation panel or read-only panel, depending on the plug-in attributes.

Content Column

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is BLOB and stores a document's file contents.

Filename Column

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is VARCHAR2 and stores a document's filename (including the file extension).

MIME Type Column

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is VARCHAR2 and stores a document's file MIME type.

Last Update Column

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is TIMESTAMP(6) and stores a document's last modification time.

Version Column

TypeRequiredDependent on
TextNoSource \ Custom Table

A column name whose type is VARCHAR2 and stores a document's current version.

Owner Column

TypeRequiredDependent on
TextYesSource \ Custom Table

A column name whose type is VARCHAR2 and stores a document's owner name (APEX user name).

Document Permissions

TypeRequiredDependent on
Select listYesNone

Available options include:

  • Everyone can read and edit
  • Only the author can read and edit
  • Everyone can read, but only the author can edit
  • Custom function returning document permissions

Everyone can read and edit

PDF Region Pro allows all users to read and edit all requested files.

Only the author can read and edit

A document author is the APEX end-user username stored in the column OWNER.

Everyone can read, but only the author can edit

PDF Region Pro allows all users to preview any file, but only the author can modify a document.

Custom function returning document permissions

The plug-in uses a custom PL/SQL function defined as the plug-in variable g_doc_func_file_perm in Initialization PL/SQL Code attribute to distinguish the current end-user permission to the currently requested document.

Annotation User

TypeRequiredDependent on
TextNoNone

This is the user name used to create annotations. The default value is Guest.

Custom PL/SQL Package Name

TypeRequiredDependent on
TextNoNone

This package executes the additional procedures and functions defined in the Initialization PL/SQL Code attribute.

Initialization PL/SQL Code

TypeRequiredDependent on
PL/SQL CodeNoNone

The attribute sets additional configuration options using the variables described below. The provided PL/SQL code is evaluated when the PDF Region Pro Editor is rendered.

Variables

g_default_versioning
TypeUsed whenExample
BooleanSource = Default TableUC_PDF_REGION_PRO.g_default_versioning := true;
UC_PDF_REGION_PRO.g_default_versioning := true;

When set to true

Saving a document results in:

  • updating a document in the table UC_PDF_DEFAULT_FILES
  • creating a new version in the table UC_PDF_DEFAULT_VERSIONS

When set to false or when not defined

Saving a document results in updating a document in the table UC_PDF_DEFAULT_FILES, but document versioning in the table UC_PDF_DEFAULT_VERSIONS is ignored.

g_doc_func_file_perm
TypeUsed whenExample
VARCHAR2(30)Document Permissions = Custom function returning document permissionsUC_PDF_REGION_PRO.g_doc_func_file_perm := 'uc_pdf_region_pro_fn_file_perm';

Provide a function name returning the end-user permissions to the currently requested document.

The given function must:

  • be declared in the package provided via Custom PL/SQL Package Name attribute
  • accept the specified arguments (described below)
  • return a VARCHAR2 string containing the end-user permissions to the requested document

The function specification is the following:

function function_name(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_file_id in varchar2,
p_user_id in varchar2
) return VARCHAR2;
ParameterTypeDescription
p_application_idNUMBERAn application ID in which the PDF Region Pro is running
p_page_idNUMBERAn application page ID in which PDF Region Pro is running
p_session_idNUMBERAn application session ID in which PDF Region Pro is running
p_file_idVARCHAR2A document ID. When PDF Region Pro uses a custom table and multiple primary keys, the value contains a comma-separated list of primary key values.
p_user_idVARCHAR2An APEX application end-user username
Document permissions pattern

The returned value from the function must follow the pattern C:L:U:S:R:P:E where:

  • C is permission to create a document
  • L is permission to load a document,
  • U is permission to update a document,
  • P is permission to print a document,
  • E is permission to export a document

Allowed values are 0 and 1, where:

  • 0 is permission denied,
  • 1 is permission granted.
g_doc_func_get_file_id
TypeUsed whenExample
VARCHAR2(30)Source = Custom TableUC_PDF_REGION_PRO.g_doc_func_get_file_id := 'uc_pdf_region_pro_fn_file_get_new_id';

Provide a function that returns a document's primary key(s) value(s) when the end-user creates a new file. Use this function only when primary key(s) value(s) can't be obtained using a trigger or other database methods. The function should return a VARCHAR2 value containing new document primary key(s) value(s) separated with a comma.

The given function must:

  • be declared in the package provided via the Custom PL/SQL Package Name attribute
  • accept the defined arguments
  • return a VARCHAR2 string containing the new document primary key(s) value(s) delimited with a comma

The function specification is the following:

function uc_pdf_region_pro_fn_file_get_new_id(
p_session_id in number,
p_application_id in number,
p_page_id in number,
p_user_id in varchar2,
p_pks_column_names in varchar2,
p_pks_item_values in varchar2
) return varchar2;

The function parameters are:

ParameterTypeDescription
p_application_idNUMBERAn application ID in which the PDF Region Pro is running
p_page_idNUMBERAn application page ID in which PDF Region Pro is running
p_session_idNUMBERAn application session ID in which PDF Region Pro is running
p_file_idVARCHAR2A document ID. When PDF Region Pro uses a custom table and multiple primary keys, the value contains a comma-separated list of primary key values
p_user_idVARCHAR2An APEX application end-user username
p_pks_column_namesVARCHAR2The current value of the Primary Key(s) Column(s) attribute
p_pks_item_valuesVARCHAR2The current value of the Item(s) Containing Primary Key(s) Value(s) attribute
Example

When PDF Region Pro uses a custom table with two primary keys, ID and ID2, the function should return the value X,Y where:

  • X is a new value for column ID
  • Y is a new value for column ID2
...
function example_function(
p_session_id in number,
p_application_id in number,
p_page_id in number,
p_user_id in varchar2,
p_pks_column_names in varchar2,
p_pks_item_values in varchar2
) return varchar2
is
v_result varchar2(4000);
begin
v_result := 'X,Y';

return v_result;
end;
...
g_doc_getfileinfo
TypeUsed whenExample
VARCHAR2(30)Source = Custom PL/SQL CodeUC_PDF_REGION_PRO.g_doc_getfileinfo := 'uc_pdf_region_pro_custom_getfileinfo';

Provide a procedure name that fetches information about the currently requested document.

The given procedure must:

  • be declared in the package provided via the Custom PL/SQL Package Name attribute
  • accept the defined arguments
  • return OUT parameters describing the requested document

The procedure specification is:

procedure uc_pdf_region_pro_custom_getfileinfo(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_out_content out blob,
p_out_filename out varchar2,
p_out_mime_type out varchar2,
p_out_last_update_date out timestamp,
p_out_version out varchar2,
p_out_blob_owner out varchar2
);

The procedure parameters are:

ParameterTypeNULL ableDescription
p_application_idNUMBERNoAn application ID in which PDF Region Pro is running
p_page_idNUMBERNoAn application page ID in which PDF Region Pro is running
p_session_idNUMBERNoAn application session ID in which PDF Region Pro is running
p_file_idVARCHAR2NoA document ID. When PDF Region Pro uses a custom table and multiple primary keys, the value contains a comma-separated list of primary keys values
p_user_idVARCHAR2NoAn APEX application end-user username
p_out_contentBLOBNoThe requested document contents.
p_out_filenameVARCHAR2NoThe requested document filename.
p_out_mime_typeVARCHAR2NoThe requested document MIME-TYPE
p_out_last_update_dateTIMESTAMPNoThe requested document's last modification as a TIMESTAMP
p_out_versionVARCHAR2YesThe requested document's current version. The current document version is not required to fetch the document information successfully.
p_out_blob_ownerVARCHAR2NoThe requested document owner.
g_doc_create
TypeUsed whenExample
VARCHAR2(30)Source = Custom PL/SQL CodeUC_PDF_REGION_PRO.g_doc_create := 'uc_pdf_region_pro_custom_create';

Provide a procedure name for saving a new document of the requested type based on an empty BLOB template.

The given procedure must:

  • be declared in the package provided via the Custom PL/SQL Package Name attribute
  • accept the defined arguments
  • return OUT parameters

The procedure specification is the following:

procedure uc_pdf_region_pro_custom_create(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id out varchar2,
p_file_content in blob,
p_file_filename in out varchar2,
p_file_mime_type in varchar2,
p_file_last_update_date in out timestamp,
p_file_version in out number,
p_file_blob_owner in out varchar2
);

The procedure parameters are:

ParameterNULL ableDescription
p_application_idNoAn application ID in which PDF Region Pro is running
p_page_idNoAn application page ID in which PDF Region Pro is running
p_session_idNoAn application session ID in which PDF Region Pro is running
p_user_idNoAn APEX application end-user username
p_file_idNoThe procedure has to set the OUT value to identify a newly created document.
p_file_contentNoThe procedure receives an empty BLOB template of the requested type.
p_file_filenameNoThe procedure receives a default filename defined in the plug-in application component settings and a file extension of the given type. The procedure can modify the received filename, and it has to set it as the OUT parameter value.
p_file_mime_typeNoThe procedure receives a requested document MIME-TYPE.
p_file_last_update_dateNoThe procedure receives a SYSTIMESTAMP, and sets the OUT parameter value with the current document modification time as a TIMESTAMP.
p_file_versionYesThe requested document's current version. The current document's version is not required to handle a document successfully.
p_file_blob_ownerNoThe requested document owner that will be used while evaluating document permissions.
g_doc_update
TypeUsed whenExample
VARCHAR2(30)Source = Custom PL/SQL CodeUC_PDF_REGION_PRO.g_doc_update := 'uc_pdf_region_pro_custom_update';

Provide a procedure name to update a document.

The given procedure must:

  • be declared in the package provided via the Custom PL/SQL Package Name attribute
  • accept the defined arguments
  • return OUT parameters

The procedure specification is:

procedure uc_pdf_region_pro_custom_update(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_file_content in blob,
p_file_filename in varchar2,
p_file_mime_type in varchar2,
p_file_last_update_date in out timestamp,
p_file_version in out number,
p_file_blob_owner in varchar2
);

The procedure parameters are:

ParameterNULL ableDescription
p_application_idNoAn application ID in which PDF Region Pro is running
p_page_idNoAn application page ID in which PDF Region Pro is running
p_session_idNoAn application session ID in which PDF Region Pro is running
p_user_idNoAn APEX application end-user username
p_file_idNoA procedure has to set the OUT value identifying a newly created document.
p_file_contentNoA procedure receives an empty BLOB template of the requested type.
p_file_filenameNoA procedure receives the current document filename.
p_file_mime_typeNoA procedure receives the current document MIME-TYPE.
p_file_last_update_dateNoA procedure receives the last document modification time and sets the OUT parameter value with the current modification time as a TIMESTAMP.
p_file_versionYesA requested document's current version. The current document version is not required to handle a document successfully.
p_file_blob_ownerNoThe current document owner.
g_doc_callback_create
TypeUsed whenRequiredExample
VARCHAR2(30)Source = Default Table | Custom Table | Custom PL/SQLNoUC_PDF_REGION_PRO.g_doc_callback_read := 'uc_pdf_region_pro_callback_create';

Provide a procedure name to be executed whenever the end-user successfully creates a document.

If not provided, PDF Region Pro does not execute the callback.

The given procedure must:

  • be declared in the package provided via Custom PL/SQL Package Name attribute
  • accept the defined arguments

The procedure specification is the following:

procedure uc_pdf_region_pro_callback_create(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_file_content in blob,
p_file_filename in varchar2,
p_file_mime_type in varchar2,
p_file_last_update_date in timestamp,
p_file_version in number,
p_file_blob_owner in varchar2
);

The procedure parameters are:

ParameterNULL ableDescription
p_application_idNoAn application ID in which PDF Region Pro is running
p_page_idNoAn application page ID in which PDF Region Pro is running
p_session_idNoAn application session ID in which PDF Region Pro is running
p_user_idNoAn APEX application end-user username
p_file_idNoThe procedure receives the current document ID to be renamed.
p_file_contentNoThe procedure receives the current document BLOB which is an empty template.
p_file_filenameNoThe procedure receives a new filename and sets the OUT value if the procedure logic changes the filename.
p_file_mime_typeNoThe procedure receives the current document MIME-TYPE.
p_file_last_update_dateNoThe procedure receives a document's last modification time and sets the OUT value with the current modification time as a TIMESTAMP.
p_file_versionYesThe requested document's current version.
p_file_blob_ownerNoThe current document owner.
g_doc_callback_read
TypeUsed whenRequiredExample
VARCHAR2(30)Source = Default Table | Custom Table | Custom PL/SQLNoUC_PDF_REGION_PRO.g_doc_callback_read := 'uc_pdf_region_pro_callback_read';

Provide a procedure name to be executed a document's contents are read. If not provided, PDF Region Pro does not perform the callback.

The given procedure must be:

  • declared in the package provided via Custom PL/SQL Package Name attribute
  • accepting the defined arguments

The procedure specification is the following:

procedure uc_pdf_region_pro_callback_read(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_file_content in blob,
p_file_filename in varchar2,
p_file_mime_type in varchar2,
p_file_last_update_date in timestamp,
p_file_version in number,
p_file_blob_owner in varchar2
);

The procedure parameters are:

ParameterNULL ableDescription
p_application_idNoAn application ID in which PDF Region Pro is running
p_page_idNoAn application page ID in which PDF Region Pro is running
p_session_idNoAn application session ID in which PDF Region Pro is running
p_user_idNoAn APEX application end-user username
p_file_idNoThe procedure receives the current document ID to be renamed.
p_file_contentNoThe procedure receives the requested document contents as BLOB.
p_file_filenameNoThe procedure receives a new filename and sets the OUT value if the procedure logic changes the filename.
p_file_mime_typeNoThe procedure receives the current document MIME-TYPE.
p_file_last_update_dateNoThe procedure receives a document's last modification time and sets the OUT value with the current modification time as TIMESTAMP.
p_file_versionYesThe requested document's current version.
p_file_blob_ownerNoThe current document owner.
g_doc_callback_update
TypeUsed whenRequiredExample
VARCHAR2(30)Source = Default Table | Custom Table | Custom PL/SQLUC_PDF_REGION_PRO.g_doc_callback_read := 'uc_pdf_region_pro_callback_update';

Provide a procedure name to be executed when a document's contents are updated. If not provided, PDF Region Pro does not perform the callback.

The given procedure must be:

  • declared in the package provided via Custom PL/SQL Package Name attribute
  • accepting the defined arguments

The procedure specification is the following:

procedure uc_pdf_region_pro_callback_update(
p_application_id in number,
p_page_id in number,
p_session_id in number,
p_user_id in varchar2,
p_file_id in varchar2,
p_file_content in BLOB,
p_file_filename in varchar2,
p_file_mime_type in varchar2,
p_file_last_update_date in timestamp,
p_file_version in number,
p_file_blob_owner in varchar2
);

The procedure parameters are:

ParameterNULL ableDescription
p_application_idNoAn application ID in which the PDF Region Pro is running
p_page_idNoAn application page ID in which PDF Region Pro is running
p_session_idNoAn application session ID in which PDF Region Pro is running
p_user_idNoAn APEX application end-user username
p_file_idNoThe procedure receives the current document ID to be renamed.
p_file_contentNoThe procedure receives the modified document as BLOB.
p_file_filenameNoThe procedure receives a new filename and sets the OUT value if the procedure logic changes the filename.
p_file_mime_typeNoThe procedure receives the current document MIME-TYPE.
p_file_last_update_dateNoThe procedure receives a document's last modification time and sets the OUT value with the current modification time as a TIMESTAMP.
p_file_versionYesThe requested document's current version.
p_file_blob_ownerNoThe current document owner.