SlideShare una empresa de Scribd logo
1 de 72
High Quality Printing with
APEX & PL/PDF

                             Scott Spendolini
                   Executive Director, Enkitec




                                                 1
WELCOME




          2
About the Presenter
 Scott Spendolini
  scott.spendolini@enkitec.com
  @sspendol

  Ex-Oracle Employee of 10 years
    Senior Product Manager for Oracle APEX
     from 2002 through 2005

  Founded Sumner Technologies
   in October 2005
  Co-Founded Sumneva in January 2010

  Joined Enkitec in June 2012
  Oracle Ace Director

  Co-Author, Pro Oracle Application Express
  Author, Secure APEX Development Best
   Practices
  “Scott” on OTN Forums



                                               3
About Enkitec
 Oracle Platinum Partner
  Established in 2004
  Headquartered in Dallas, TX
  Locations throughout the US & EMEA

 Specialties include
  Exadata Implementations
  Development Services
   PL/SQL / Java / APEX

  DBA/Data Warehouse/RAC
  Business Intelligence


                                        4
Agenda
 Overview
 Installation
 APEX Integration
 Common APIs
 Extras
 Summary




                     5
OVERVIEW




           6
APEX & Printing
 APEX is over 10 years old
  Initial code was started on 4-AUG-1999

 As much as it has advanced over the years, there
  is still no de-facto,“go to” printing solution




                                                     7
Poll
 What printing technology do you use in
  conjunction with APEX?
  “Printer Friendly” Mode
  Apache FOP
  Crystal Reports
  Jasper Reports
  Oracle BI Publisher
  PL/PDF
  File > Print
  Other

                                           8
Options

                                                Add’l
      Name          Ease of Use        Power                   Cost
                                               Server
Printer Friendly
                   ★★★★★                                Free
Mode

Apache FOP         ★★★★★          ★★             ✔      Free


Jasper Reports     ★★★★           ★★★★           ✔      $$


Crystal Reports    ★★★★           ★★★★           ✔      $$$

Oracle BI
                   ★★★★           ★★★★★          ✔      $$$$$
Publisher

PL/PDF             ★★★            ★★★★                  $




                                                                      9
What is PL/PDF?
 Third party product designed by Oranext
  http://plpdf.com
 Provides a set of PL/SQL based APIs that can
 generate PDF files from the Oracle database
 Easy to securely integrate with APEX
 Can be called from a Page or Application Process




                                                     10
PL/PDF Features
 Robust reporting engine
 Charts
  Bar, Line & Pie

 Barcode Printing
 Use Existing PDF files as Templates
 TrueType Font Embedding
 Encrypted PDF Documents
 Native Support for PNG & JPEG images
  Other types supported via Oracle InterMedia

                                                 11
Licensing
 Licensed per instance of Oracle
  $600 per instance

 Can download a trial for free
  5 Page Maximum
  Watermark Appears on all pages

 No additional hardware is required
  PL/PDF installs into the same database as APEX




                                                    12
The BLOB!
 Result of PL/PDF is nothing more than an Oracle
  BLOB
 Thus, you can do anything with PL/PDF output
  that you can with an Oracle BLOB:
  E-Mail it as an attachment
  Download it to a browser
  Store it in a table
  Index it with Oracle Text
  Schedule a procedure to
   generate and e-mail PDF files


                                                    13
Simple Example



plpdf.init;
plpdf.NewPage;
plpdf.SetPrintFont('Arial',NULL,12);
plpdf.PrintCell(50,10,'Hello World');
plpdf.SendDoc(l_blob);




                                        14
Complex Example
 eSERT Evaluation Summary Report




                                    15
Layout & Control
 All layout is handled via API calls
  There is no GUI tool to design a PL/PDF report

 Seems limiting, and can be at times
  Template feature allows you to use any tool to create the
   structure of a document and use PL/PDF APIs only to
   populate the data
  Also, there are APIs that minimize the amount of code
   required when creating reports




                                                               16
Sweet Spots
 PL/PDF is the best solution when:
  The core report definition does not change often
  End Users do not need to create one-off reports
  You have an abundance of PL/SQL resources and little
   money




                                                          17
INSTALLATION




               18
Installation Options
 PL/PDF comes with a Windows-based installer
  Can use to install on any target OS
  Need to be able to connect to the target database via
   SQL*Net

 Alternatively, you can run the scripts manually via
  command prompt
 In either case, installation should take about 5-10
  minutes




                                                           19
Where to Put It
 Since PL/PDF is a set of PL/SQL objects, you’ll
  need to select a schema to put it in
  Typically use PLPDF, but can name the schema anything

 Best to use its own schema and then create
  grants & synonyms to access from other schemas
  You’ll need to do this manually
  Start with just PLPDF & PLPDF_TYPE; synonyms for other
   objects can be added as needed




                                                            20
APEX INTEGRATION




                   21
APEX Integration
 Once installed and the corresponding grants are
  created to your parse as schema, there is
  NOTHING ADDITIONAL TO CONFIGURE in order to
  integrate PL/PDF with APEX
 PL/PDF - like APEX - is PL/SQL
  Thus, as long as your parse-as schema can access the
   PL/PDF objects, that’s all you’ll need
   Seriously.

     There’s nothing else to configure.

       Try it. You’ll see.




                                                          22
APEX Integration
 PL/PDF must be called as part of the Page
  Rendering process in APEX
  And it must occur before anything else

 Best Practice:
  Create an On Load PL/SQL Process that calls PL/PDF
  Set the Condition to Request = Expression 1
  Add a button/link to that page which sets the Request to
   trigger the PL/PDF call




                                                              23
APEX INTEGRATION
D E M O N S T R A T I O N




                            24
COMMON APIS




              25
Common APIs
 PL/PDF is nothing more than a set of PL/SQL APIs
  Like any other API set, there’s a learning curve

 Most APIs have default values on most
  parameters
  Thus you only need to pass values to those you wish to set
  Use param => value notation for best results

 Refer to the documentation for full details




                                                                26
LAYOUT & CONTROL




                   27
init
 Called once to initialize PL/PDF
 Parameters:
  p_orientation
  p_unit
  p_format




                                     28
newPage
 Creates a new page
 Called anytime a new page is needed
  PL/PDF will automatically create a new page when
   needed if data overflows the current page

 Parameters:
  p_orientation




                                                      29
setPrintFont
 Sets the font family and style used for text
 Parameters:
  p_family
  p_style
  p_size




                                                 30
printCell
 Prints a line of text on the page
 Parameters:
   •   p_w                •   p_align

   •   p_h                •   p_fill

   •   p_txt              •   p_link

   •   p_border           •   p_clipping

   •   p_ln




                                           31
sendDoc
 Returns the PDF document to a BLOB variable
 Parameters:
  p_blob




                                                32
BASIC REPORT
D E M O N S T R A T I O N




                            33
lineBreak
 Places the cursor on the next line
 Parameters:
  p_h




                                       34
LINE BREAK
D E M O N S T R A T I O N




                            35
setCurrentXY
 Sets the position of the cursor
 Parameters:
  p_x
  p_y

 Similar:
  setCurrentX
  setCurrentY




                                    36
SET CURSOR POSITION
D E M O N S T R A T I O N




                            37
setColor4Text
 Sets the font color used for text
 Parameters:
  p_r
  p_g
  p_b

 Alternatively:
  p_color




                                      38
setColor4Filling
 Sets the background color used for text
 Parameters:
  p_r
  p_g
  p_b

 Alternatively:
  p_color




                                            39
API for the API
 In some cases, you may want to create your own
  API to simplify the number of PL/PDF API calls
  required
 For example, a single API can consolidate the
  following three PL/PDF APIs:
  setPrintFont
  setColor4Text
  setColor4Filling




                                                   40
set_font API

PROCEDURE set_font
   (
   p_family     IN   VARCHAR2   DEFAULT      'Arial',
   p_size       IN   NUMBER     DEFAULT      10,
   p_style      IN   VARCHAR2   DEFAULT      NULL,
   p_r          IN   NUMBER     DEFAULT      0,
   p_g          IN   NUMBER     DEFAULT      0,
   p_b          IN   NUMBER     DEFAULT      0,
   p_r_bkg      IN   NUMBER     DEFAULT      255,
   p_g_bkg      IN   NUMBER     DEFAULT      255,
   p_b_bkg      IN   NUMBER     DEFAULT      255
   )
IS                       Called without parameters, the font will
                         be set to Arial 10 normal (black on white)
BEGIN


                                                                      41
set_font API
plpdf.SetPrintFont(
  p_family => p_family,
  p_style => p_style,
  p_size => p_size);

plpdf.SetColor4Text(
  p_r => p_r,
  p_g => p_g,
  p_b => p_b);

plpdf.SetColor4Filling(
  p_r => p_r_bkg,
  p_g => p_g_bkg,
  p_b => p_b_bkg);

END;


                          42
Download File API
 You can also create a single procedure to handle
  file downloads
  Pass in the BLOB and filename
  All PL/PDF reports can call this procedure

 In fact, it is recommended that PL/PDF reports
  be based on a package
  Reusability
  Security




                                                     43
SET_FONT &
DOWNLOAD_FILE       API
D E M O N S T R A T I O N




                            44
setHeaderProcName
 Sets which procedure to call to produce the page
  header
 Parameters:
  p_proc_name
  p_height




                                                     45
setFooterProcName
 Sets which procedure to call to produce the page
  footer
 Parameters:
  p_proc_name
  p_height




                                                     46
Note on Privileges
 The procedure named in the header and footer
  calls must be able to be called by the schema in
  which PL/PDF is installed
  Not a problem is PL/PDF is installed in the same schema
   as your PL/SQL

 You can not pass parameters to this procedure
  directly, but can do so via SYSCONTEXT




                                                             47
PAGE HEADER & FOOTER
D E M O N S T R A T I O N




                            48
REPORTS




          49
Printing a Report
 Whether you’re printing a report that is 1 or 100
  pages, there are better, more specific APIs for
  that
  QUERY_PRINT
   Pass a SQL Statement, get a report

  ROW_PRINT
   Allows you to loop through a SQL statement or Dynamic SQL and have
    more control over the resulting report




                                                                         50
query_print
 Designed to enable developers to quickly take a
  SQL statement and generate a PDF document
  from it
  Limited formatting options and control
  Eight different variations are available: QUERY_PRINT_01
   through QUERY_PRINT_08




                                                              51
query_print
 Technically a one-off API not included in the
  PL/PDF Distribution
 Can be downloaded from PL/PDF’s site
  For Developers > Examples > PLPDF-SDK > Complex
   Examples > Query Print




                                                     52
query_print
 Parameters:
 procedure query_print_01(
   p_query       varchar2,
   p_height      number,
   p_header_fill number default 0
   );


 procedure query_print_09(
   p_query       varchar2,
   p_height      number,
   p_cellwidth   number,
   p_numbercells number,
   p_datecells   number,
   p_maxcells    number default 0,
   p_header_fill number default 0
   );




                                     53
QUERY_PRINT
D E M O N S T R A T I O N




                            54
row_print
 ROW_PRINT allows for a lot more flexibility than
  QUERY_PRINT
 Typically called from inside a loop
  FOR X IN (SELECT * FROM ...)
  DBMS_SQL

 Four different variations are available:
  ROW_PRINT through ROW_PRINT4




                                                     55
row_print
 Sample Parameters
  p_data
  p_width
  p_align
  p_style
  p_maxline
  p_links
  p_h
  p_fill
  p_min_height
  p_clipping


                      56
ROW_PRINT
D E M O N S T R A T I O N




                            57
Table of Contents
 PL/PDF allows you to automatically crete a Table
  of Contents
  You can add “bookmarks” throughout your application that
   link back to the main table of contents
  Fully automated; no need to calculate anything




                                                              58
TABLE OF CONTENTS
D E M O N S T R A T I O N




                            59
EXTRAS




         60
Extras
 In addition to its core APIs, PL/PDF offers a
  number of extra features
  Templates
  Charts
   Bar, Line & Pie

  Bar Codes
  Encryption
  OpenOffice Forms
  TrueType Font Support




                                                  61
Templates
 PL/PDF allows you to include a PDF template as a
  background for any page
  No need to use PL/PDF to create the structure of a
   document; focus on filling in the data
  Any PDF document can be used
   Easy to create PDF documents from Word, Acrobat, etc.




                                                            62
Templates




            63
TEMPLATES
D E M O N S T R A T I O N




                            64
Charts
 Support for three types of charts
  Line
  Bar
  Pie




                                      65
Charts
  sumnevaSERT


  Settings Summary                                                                    28 out of 37 possible points        75.68%
  Session Duration
                                 0%                               Authentication Scheme: 1
  0 out of 2 possible points
  Security
                                 60%
  6 out of 10 possible points
  Application Settings
                                 84.62%
  11 out of 13 possible points                   Session Duration: 2                                        Security: 4
  Authentication Scheme
                                 91.67%
  11 out of 12 possible points




                                                                       Application Settings: 2




                                          Exceptions Awaiting Approval

                                          No Data Found

                                          Stale Exceptions

                                          No Data Found




                                                                                                                                   66
Barcodes
 Support for a number of types of barcodes:
Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB
8543                       8543                       8543                       8543



                  $36.99                     $36.99                     $36.99                     $36.99
101262640                  101262640                  101262640                  101262640


Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB
8543                       8543                       8543                       8543



                  $36.99                     $36.99                     $36.99                     $36.99
101262640                  101262640                  101262640                  101262640


Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB
8543                       8543                       8543                       8543



                  $36.99                     $36.99                     $36.99                     $36.99
101262640                  101262640                  101262640                  101262640


Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB       Feline Adult 20/22LB
8543                       8543                       8543                       8543



                  $36.99                     $36.99                     $36.99                     $36.99
101262640                  101262640                  101262640                  101262640

                                                                                                            67
Other Features
 Ability to encrypt PDF files
 Support for OpenOffice PDF Forms
 LZW compression
 TrueType Font Support




                                     68
SUMMARY




          69
Summary
 PL/PDF provides a robust, cost effective
  solution for producing high quality PDF
  documents from any APEX application
  Not always the right tool for every job; but in many cases,
   it works quite well
  Low cost and zero footprint means that it should at least
   be seriously considered




                                                                 70
Download
 This and all other Enkitec presentations can be
  downloaded for free from:

 http://enkitec.com/presentations




                                                    71
http://www.enkitec.com




                         72

Más contenido relacionado

Más de Enkitec

Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the TradeEnkitec
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsEnkitec
 
SQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeSQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeEnkitec
 
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan StabilityUsing SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan StabilityEnkitec
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceEnkitec
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture PerformanceEnkitec
 
APEX Security Primer
APEX Security PrimerAPEX Security Primer
APEX Security PrimerEnkitec
 
How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?Enkitec
 
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Enkitec
 
Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Enkitec
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writerEnkitec
 
Fatkulin hotsos 2014
Fatkulin hotsos 2014Fatkulin hotsos 2014
Fatkulin hotsos 2014Enkitec
 
Combining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM StabilityCombining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM StabilityEnkitec
 
Why You May Not Need Offloading
Why You May Not Need OffloadingWhy You May Not Need Offloading
Why You May Not Need OffloadingEnkitec
 
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEXLOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEXEnkitec
 
Creating a Business Oriented UI in APEX
Creating a Business Oriented UI in APEXCreating a Business Oriented UI in APEX
Creating a Business Oriented UI in APEXEnkitec
 
Colvin RMAN New Features
Colvin RMAN New FeaturesColvin RMAN New Features
Colvin RMAN New FeaturesEnkitec
 
Enkitec Exadata Human Factor
Enkitec Exadata Human FactorEnkitec Exadata Human Factor
Enkitec Exadata Human FactorEnkitec
 
About Multiblock Reads v4
About Multiblock Reads v4About Multiblock Reads v4
About Multiblock Reads v4Enkitec
 
Performance data visualization with r and tableau
Performance data visualization with r and tableauPerformance data visualization with r and tableau
Performance data visualization with r and tableauEnkitec
 

Más de Enkitec (20)

Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
SQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeSQL Tuning Tools of the Trade
SQL Tuning Tools of the Trade
 
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan StabilityUsing SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan Stability
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 
APEX Security Primer
APEX Security PrimerAPEX Security Primer
APEX Security Primer
 
How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?
 
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
 
Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 
Fatkulin hotsos 2014
Fatkulin hotsos 2014Fatkulin hotsos 2014
Fatkulin hotsos 2014
 
Combining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM StabilityCombining ACS Flexibility with SPM Stability
Combining ACS Flexibility with SPM Stability
 
Why You May Not Need Offloading
Why You May Not Need OffloadingWhy You May Not Need Offloading
Why You May Not Need Offloading
 
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEXLOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
 
Creating a Business Oriented UI in APEX
Creating a Business Oriented UI in APEXCreating a Business Oriented UI in APEX
Creating a Business Oriented UI in APEX
 
Colvin RMAN New Features
Colvin RMAN New FeaturesColvin RMAN New Features
Colvin RMAN New Features
 
Enkitec Exadata Human Factor
Enkitec Exadata Human FactorEnkitec Exadata Human Factor
Enkitec Exadata Human Factor
 
About Multiblock Reads v4
About Multiblock Reads v4About Multiblock Reads v4
About Multiblock Reads v4
 
Performance data visualization with r and tableau
Performance data visualization with r and tableauPerformance data visualization with r and tableau
Performance data visualization with r and tableau
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

High Quality Printing with APEX and PL/PDF

  • 1. High Quality Printing with APEX & PL/PDF Scott Spendolini Executive Director, Enkitec 1
  • 3. About the Presenter  Scott Spendolini  scott.spendolini@enkitec.com  @sspendol  Ex-Oracle Employee of 10 years  Senior Product Manager for Oracle APEX from 2002 through 2005  Founded Sumner Technologies in October 2005  Co-Founded Sumneva in January 2010  Joined Enkitec in June 2012  Oracle Ace Director  Co-Author, Pro Oracle Application Express  Author, Secure APEX Development Best Practices  “Scott” on OTN Forums 3
  • 4. About Enkitec  Oracle Platinum Partner  Established in 2004  Headquartered in Dallas, TX  Locations throughout the US & EMEA  Specialties include  Exadata Implementations  Development Services  PL/SQL / Java / APEX  DBA/Data Warehouse/RAC  Business Intelligence 4
  • 5. Agenda  Overview  Installation  APEX Integration  Common APIs  Extras  Summary 5
  • 7. APEX & Printing  APEX is over 10 years old  Initial code was started on 4-AUG-1999  As much as it has advanced over the years, there is still no de-facto,“go to” printing solution 7
  • 8. Poll  What printing technology do you use in conjunction with APEX?  “Printer Friendly” Mode  Apache FOP  Crystal Reports  Jasper Reports  Oracle BI Publisher  PL/PDF  File > Print  Other 8
  • 9. Options Add’l Name Ease of Use Power Cost Server Printer Friendly ★★★★★ Free Mode Apache FOP ★★★★★ ★★ ✔ Free Jasper Reports ★★★★ ★★★★ ✔ $$ Crystal Reports ★★★★ ★★★★ ✔ $$$ Oracle BI ★★★★ ★★★★★ ✔ $$$$$ Publisher PL/PDF ★★★ ★★★★ $ 9
  • 10. What is PL/PDF?  Third party product designed by Oranext  http://plpdf.com  Provides a set of PL/SQL based APIs that can generate PDF files from the Oracle database  Easy to securely integrate with APEX  Can be called from a Page or Application Process 10
  • 11. PL/PDF Features  Robust reporting engine  Charts  Bar, Line & Pie  Barcode Printing  Use Existing PDF files as Templates  TrueType Font Embedding  Encrypted PDF Documents  Native Support for PNG & JPEG images  Other types supported via Oracle InterMedia 11
  • 12. Licensing  Licensed per instance of Oracle  $600 per instance  Can download a trial for free  5 Page Maximum  Watermark Appears on all pages  No additional hardware is required  PL/PDF installs into the same database as APEX 12
  • 13. The BLOB!  Result of PL/PDF is nothing more than an Oracle BLOB  Thus, you can do anything with PL/PDF output that you can with an Oracle BLOB:  E-Mail it as an attachment  Download it to a browser  Store it in a table  Index it with Oracle Text  Schedule a procedure to generate and e-mail PDF files 13
  • 15. Complex Example  eSERT Evaluation Summary Report 15
  • 16. Layout & Control  All layout is handled via API calls  There is no GUI tool to design a PL/PDF report  Seems limiting, and can be at times  Template feature allows you to use any tool to create the structure of a document and use PL/PDF APIs only to populate the data  Also, there are APIs that minimize the amount of code required when creating reports 16
  • 17. Sweet Spots  PL/PDF is the best solution when:  The core report definition does not change often  End Users do not need to create one-off reports  You have an abundance of PL/SQL resources and little money 17
  • 19. Installation Options  PL/PDF comes with a Windows-based installer  Can use to install on any target OS  Need to be able to connect to the target database via SQL*Net  Alternatively, you can run the scripts manually via command prompt  In either case, installation should take about 5-10 minutes 19
  • 20. Where to Put It  Since PL/PDF is a set of PL/SQL objects, you’ll need to select a schema to put it in  Typically use PLPDF, but can name the schema anything  Best to use its own schema and then create grants & synonyms to access from other schemas  You’ll need to do this manually  Start with just PLPDF & PLPDF_TYPE; synonyms for other objects can be added as needed 20
  • 22. APEX Integration  Once installed and the corresponding grants are created to your parse as schema, there is NOTHING ADDITIONAL TO CONFIGURE in order to integrate PL/PDF with APEX  PL/PDF - like APEX - is PL/SQL  Thus, as long as your parse-as schema can access the PL/PDF objects, that’s all you’ll need  Seriously.  There’s nothing else to configure.  Try it. You’ll see. 22
  • 23. APEX Integration  PL/PDF must be called as part of the Page Rendering process in APEX  And it must occur before anything else  Best Practice:  Create an On Load PL/SQL Process that calls PL/PDF  Set the Condition to Request = Expression 1  Add a button/link to that page which sets the Request to trigger the PL/PDF call 23
  • 24. APEX INTEGRATION D E M O N S T R A T I O N 24
  • 26. Common APIs  PL/PDF is nothing more than a set of PL/SQL APIs  Like any other API set, there’s a learning curve  Most APIs have default values on most parameters  Thus you only need to pass values to those you wish to set  Use param => value notation for best results  Refer to the documentation for full details 26
  • 28. init  Called once to initialize PL/PDF  Parameters:  p_orientation  p_unit  p_format 28
  • 29. newPage  Creates a new page  Called anytime a new page is needed  PL/PDF will automatically create a new page when needed if data overflows the current page  Parameters:  p_orientation 29
  • 30. setPrintFont  Sets the font family and style used for text  Parameters:  p_family  p_style  p_size 30
  • 31. printCell  Prints a line of text on the page  Parameters: • p_w • p_align • p_h • p_fill • p_txt • p_link • p_border • p_clipping • p_ln 31
  • 32. sendDoc  Returns the PDF document to a BLOB variable  Parameters:  p_blob 32
  • 33. BASIC REPORT D E M O N S T R A T I O N 33
  • 34. lineBreak  Places the cursor on the next line  Parameters:  p_h 34
  • 35. LINE BREAK D E M O N S T R A T I O N 35
  • 36. setCurrentXY  Sets the position of the cursor  Parameters:  p_x  p_y  Similar:  setCurrentX  setCurrentY 36
  • 37. SET CURSOR POSITION D E M O N S T R A T I O N 37
  • 38. setColor4Text  Sets the font color used for text  Parameters:  p_r  p_g  p_b  Alternatively:  p_color 38
  • 39. setColor4Filling  Sets the background color used for text  Parameters:  p_r  p_g  p_b  Alternatively:  p_color 39
  • 40. API for the API  In some cases, you may want to create your own API to simplify the number of PL/PDF API calls required  For example, a single API can consolidate the following three PL/PDF APIs:  setPrintFont  setColor4Text  setColor4Filling 40
  • 41. set_font API PROCEDURE set_font ( p_family IN VARCHAR2 DEFAULT 'Arial', p_size IN NUMBER DEFAULT 10, p_style IN VARCHAR2 DEFAULT NULL, p_r IN NUMBER DEFAULT 0, p_g IN NUMBER DEFAULT 0, p_b IN NUMBER DEFAULT 0, p_r_bkg IN NUMBER DEFAULT 255, p_g_bkg IN NUMBER DEFAULT 255, p_b_bkg IN NUMBER DEFAULT 255 ) IS Called without parameters, the font will be set to Arial 10 normal (black on white) BEGIN 41
  • 42. set_font API plpdf.SetPrintFont( p_family => p_family, p_style => p_style, p_size => p_size); plpdf.SetColor4Text( p_r => p_r, p_g => p_g, p_b => p_b); plpdf.SetColor4Filling( p_r => p_r_bkg, p_g => p_g_bkg, p_b => p_b_bkg); END; 42
  • 43. Download File API  You can also create a single procedure to handle file downloads  Pass in the BLOB and filename  All PL/PDF reports can call this procedure  In fact, it is recommended that PL/PDF reports be based on a package  Reusability  Security 43
  • 44. SET_FONT & DOWNLOAD_FILE API D E M O N S T R A T I O N 44
  • 45. setHeaderProcName  Sets which procedure to call to produce the page header  Parameters:  p_proc_name  p_height 45
  • 46. setFooterProcName  Sets which procedure to call to produce the page footer  Parameters:  p_proc_name  p_height 46
  • 47. Note on Privileges  The procedure named in the header and footer calls must be able to be called by the schema in which PL/PDF is installed  Not a problem is PL/PDF is installed in the same schema as your PL/SQL  You can not pass parameters to this procedure directly, but can do so via SYSCONTEXT 47
  • 48. PAGE HEADER & FOOTER D E M O N S T R A T I O N 48
  • 49. REPORTS 49
  • 50. Printing a Report  Whether you’re printing a report that is 1 or 100 pages, there are better, more specific APIs for that  QUERY_PRINT  Pass a SQL Statement, get a report  ROW_PRINT  Allows you to loop through a SQL statement or Dynamic SQL and have more control over the resulting report 50
  • 51. query_print  Designed to enable developers to quickly take a SQL statement and generate a PDF document from it  Limited formatting options and control  Eight different variations are available: QUERY_PRINT_01 through QUERY_PRINT_08 51
  • 52. query_print  Technically a one-off API not included in the PL/PDF Distribution  Can be downloaded from PL/PDF’s site  For Developers > Examples > PLPDF-SDK > Complex Examples > Query Print 52
  • 53. query_print  Parameters: procedure query_print_01( p_query varchar2, p_height number, p_header_fill number default 0 ); procedure query_print_09( p_query varchar2, p_height number, p_cellwidth number, p_numbercells number, p_datecells number, p_maxcells number default 0, p_header_fill number default 0 ); 53
  • 54. QUERY_PRINT D E M O N S T R A T I O N 54
  • 55. row_print  ROW_PRINT allows for a lot more flexibility than QUERY_PRINT  Typically called from inside a loop  FOR X IN (SELECT * FROM ...)  DBMS_SQL  Four different variations are available: ROW_PRINT through ROW_PRINT4 55
  • 56. row_print  Sample Parameters  p_data  p_width  p_align  p_style  p_maxline  p_links  p_h  p_fill  p_min_height  p_clipping 56
  • 57. ROW_PRINT D E M O N S T R A T I O N 57
  • 58. Table of Contents  PL/PDF allows you to automatically crete a Table of Contents  You can add “bookmarks” throughout your application that link back to the main table of contents  Fully automated; no need to calculate anything 58
  • 59. TABLE OF CONTENTS D E M O N S T R A T I O N 59
  • 60. EXTRAS 60
  • 61. Extras  In addition to its core APIs, PL/PDF offers a number of extra features  Templates  Charts  Bar, Line & Pie  Bar Codes  Encryption  OpenOffice Forms  TrueType Font Support 61
  • 62. Templates  PL/PDF allows you to include a PDF template as a background for any page  No need to use PL/PDF to create the structure of a document; focus on filling in the data  Any PDF document can be used  Easy to create PDF documents from Word, Acrobat, etc. 62
  • 63. Templates 63
  • 64. TEMPLATES D E M O N S T R A T I O N 64
  • 65. Charts  Support for three types of charts  Line  Bar  Pie 65
  • 66. Charts sumnevaSERT Settings Summary 28 out of 37 possible points 75.68% Session Duration 0% Authentication Scheme: 1 0 out of 2 possible points Security 60% 6 out of 10 possible points Application Settings 84.62% 11 out of 13 possible points Session Duration: 2 Security: 4 Authentication Scheme 91.67% 11 out of 12 possible points Application Settings: 2 Exceptions Awaiting Approval No Data Found Stale Exceptions No Data Found 66
  • 67. Barcodes  Support for a number of types of barcodes: Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB 8543 8543 8543 8543 $36.99 $36.99 $36.99 $36.99 101262640 101262640 101262640 101262640 Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB 8543 8543 8543 8543 $36.99 $36.99 $36.99 $36.99 101262640 101262640 101262640 101262640 Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB 8543 8543 8543 8543 $36.99 $36.99 $36.99 $36.99 101262640 101262640 101262640 101262640 Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB Feline Adult 20/22LB 8543 8543 8543 8543 $36.99 $36.99 $36.99 $36.99 101262640 101262640 101262640 101262640 67
  • 68. Other Features  Ability to encrypt PDF files  Support for OpenOffice PDF Forms  LZW compression  TrueType Font Support 68
  • 69. SUMMARY 69
  • 70. Summary  PL/PDF provides a robust, cost effective solution for producing high quality PDF documents from any APEX application  Not always the right tool for every job; but in many cases, it works quite well  Low cost and zero footprint means that it should at least be seriously considered 70
  • 71. Download  This and all other Enkitec presentations can be downloaded for free from: http://enkitec.com/presentations 71

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. simple hello world type report\n
  34. \n
  35. print a report with 2 printCells and then 2 more separated by a line break\n
  36. \n
  37. show how to move the cursor around\n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n