SlideShare une entreprise Scribd logo
1  sur  20
BUILDING PHP DOCUMENTS
      WITH CAKEPDF
      CakeFest Manchester, 2012
ABOUT ME

•   Jelle Henkens

•   LemonBE on IRC, @lemonit on Twitter

•   Belgian in the UK

•   Lead Developer at Geneo Software

•   CakePHP Core Team Developer

•   Founder of followmy.tv
WHAT IS CAKEPDF

• Generate     PDF documents from HTML

• Easily   pick which library to render the PDF

• PDF   Encryption

• Layouts, views, helpers   and more

• Use   your own encryption / render engine
WHY IT WAS BUILT
• Massive   differences in API between pdf libraries
// Using DomPdf                          // Tcpdf example

require_once("dompdf_config.inc.php");   require_once('config/lang/eng.php');
                                         require_once('tcpdf.php');
$html =
  '<html><body>'.                        $html =
  '<p>Put your html here.</p>'.            '<html><body>'.
  '</body></html>';                        '<p>Put your html here.</p>'.
                                           '</body></html>';
$dompdf = new DOMPDF();
$dompdf->set_paper('A4', 'landscape');   $tcpdf = new TCPDF('portrait', 'mm',
$dompdf->                                'A4');
$dompdf->load_html($html);               $tcpdf->AddPage();
$dompdf->render();                       $tcpdf->writeHTML($html);
$pdfData = $dompdf->output();            $pdfData = $tcpdf->Output('', 'S');
WHY IT WAS BUILT
• And   now with CakePdf
// Using DomPdf                        // Tcpdf example

App::uses('CakePdf', 'CakePdf.Pdf');   App::uses('CakePdf', 'CakePdf.Pdf');

$html =                                $html =
  '<html><body>'.                        '<html><body>'.
  '<p>Put your html here.</p>'.          '<p>Put your html here.</p>'.
  '</body></html>';                      '</body></html>';

$cakePdf = new CakePdf(array(          $cakePdf = new CakePdf(array(
    'engine' => 'CakePdf.DomPdf',          'engine' => 'CakePdf.Tcpdf',
    'orientation' => 'portrait',           'orientation' => 'portrait',
    'pageSize' => 'A4'                     'pageSize' => 'A4'
));                                    ));

$pdfData = $cakePdf->output($html);    $pdfData = $cakePdf->output($html);
WHY IT WAS BUILT
• And   now with CakePdf
// Using DomPdf                        // Tcpdf example

App::uses('CakePdf', 'CakePdf.Pdf');   App::uses('CakePdf', 'CakePdf.Pdf');

$html =                                $html =
  '<html><body>'.                        '<html><body>'.
  '<p>Put your html here.</p>'.          '<p>Put your html here.</p>'.
  '</body></html>';                      '</body></html>';

$cakePdf = new CakePdf(array(          $cakePdf = new CakePdf(array(
    'engine' => 'CakePdf.DomPdf',          'engine' => 'CakePdf.Tcpdf',
    'orientation' => 'portrait',           'orientation' => 'portrait',
    'pageSize' => 'A4'                     'pageSize' => 'A4'
));                                    ));

$pdfData = $cakePdf->output($html);    $pdfData = $cakePdf->output($html);
BUILT IN RENDER ENGINES
                         External Binary
  WkHtmlToPdf   stable
                          Uses WebKit


    DomPdf      alpha      PHP Based



     Mpdf       alpha      PHP Based



     Tcpdf      alpha      PHP Based
BUILT IN RENDER ENGINES
                               External Binary
  WkHtmlToPdf   stable
                                Uses WebKit


    DomPdf      alpha            PHP Based



     Mpdf       alpha    Very Nice!
                               PHP Based



     Tcpdf      alpha            PHP Based
CONFIGURATION
                           Setup
Add in Config/bootstrap.php

CakePlugin::load('CakePdf', array(
    'bootstrap' => true,
    'routes' => true
));



Needs RequestHandlerComponent

class AppController extends Controller {
    public $components = array('RequestHandler');
}
CONFIGURATION
           Special case for CakePHP 2.1.x
Config/bootstrap.php

CakePlugin::load('CakePdf', array(
    'bootstrap' => true
));




Config/routes.php

Router::parseExtensions('pdf');
CONFIGURATION
                            Settings
Global settings
// Config/bootstrap.php
Configure::write('CakePdf', array(
    'engine' => 'CakePdf.WkHtmlToPdf',
    'pageSize' => 'A4',
    'orientation' => 'portrait'
));

Inside the controller
public function view($id) {
    $this->pdfConfig = array(
        'orientation' => 'landscape',
        'download' => true,
        'filename' => 'invoice-2005.pdf'
    );
    .. Rest of action logic ..
}
TO VIEW OR NOT TO VIEW

• Generating   PDF files with the .pdf extension in the URL
   •   Viewing PDF documents in the browser
   •   Download to disk
   •   Smaller files
• Stand-alone   to generate raw PDF data
   •   Email attachments
   •   Offline processing
   •   Larger files
REQUESTHANDLER FLOW
              View in browser or download to disk


• Layout   file App/View/Layout/pdf/default.ctp
• View    file App/View/Orders/pdf/invoice.ctp
• All   the CakePHP goodies to your disposal
  • Helpers
  • Blocks
  • Elements
STAND-ALONE FLOW
App::uses('CakePdf', 'CakePdf.Pdf');

$CakePdf = new CakePdf(array(
    'engine' => 'CakePdf.Tcpdf',
    'pageSize' => 'A5',
    'orientation' => 'landscape',
    'margin' => 10
));

$html = '
<html><head></head>
<body><p>CakeFest is the best</p></body>
</html>';

$rawPdfData = $CakePdf->output($html);
ENCRYPTING PDF FILES

• Protect   against viewing, printing, editing and more

• pdftk   binary from PDFLabs

• 128   bit encryption

• Second    pass encryption

• Encrypt   existing PDF documents
PASSWORD TYPES
• Owner    password

 • Unlock   protected permissions

 • Cannot   be the same as the user password

• User   password

 • Will   prompt before opening the PDF Document

 • Cannot   exist without an owner password
CRYPTO CONFIGURATION

Add in Config/bootstrap.php

//Default configuration
Configure::write('CakePdf', array(
    'engine' => 'CakePdf.WkHtmlToPdf',
    'crypto' => 'CakePdf.Pdftk'
));
USING ENCRYPTING
//Action configuration
public function view($id) {
    $this->pdfConfig = array(
        'orientation' => 'landscape',
        'protect' => true,
        'userPassword' => 'foo',
        'ownerPassword' => 'bar',
        'permissions' => array(
            'print'
        )
    );
    .. Rest of action logic ..
}
TECHNICAL DEMO
http://github.com/ceeram/CakePdf




              THANKS


Jelle Henkens - @lemonit - jelle.henkens@gmail.com

Contenu connexe

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

En vedette

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

En vedette (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Building PHP Documents with CakePdf - CakeFest 2012

  • 1. BUILDING PHP DOCUMENTS WITH CAKEPDF CakeFest Manchester, 2012
  • 2. ABOUT ME • Jelle Henkens • LemonBE on IRC, @lemonit on Twitter • Belgian in the UK • Lead Developer at Geneo Software • CakePHP Core Team Developer • Founder of followmy.tv
  • 3. WHAT IS CAKEPDF • Generate PDF documents from HTML • Easily pick which library to render the PDF • PDF Encryption • Layouts, views, helpers and more • Use your own encryption / render engine
  • 4. WHY IT WAS BUILT • Massive differences in API between pdf libraries // Using DomPdf // Tcpdf example require_once("dompdf_config.inc.php"); require_once('config/lang/eng.php'); require_once('tcpdf.php'); $html = '<html><body>'. $html = '<p>Put your html here.</p>'. '<html><body>'. '</body></html>'; '<p>Put your html here.</p>'. '</body></html>'; $dompdf = new DOMPDF(); $dompdf->set_paper('A4', 'landscape'); $tcpdf = new TCPDF('portrait', 'mm', $dompdf-> 'A4'); $dompdf->load_html($html); $tcpdf->AddPage(); $dompdf->render(); $tcpdf->writeHTML($html); $pdfData = $dompdf->output(); $pdfData = $tcpdf->Output('', 'S');
  • 5. WHY IT WAS BUILT • And now with CakePdf // Using DomPdf // Tcpdf example App::uses('CakePdf', 'CakePdf.Pdf'); App::uses('CakePdf', 'CakePdf.Pdf'); $html = $html = '<html><body>'. '<html><body>'. '<p>Put your html here.</p>'. '<p>Put your html here.</p>'. '</body></html>'; '</body></html>'; $cakePdf = new CakePdf(array( $cakePdf = new CakePdf(array( 'engine' => 'CakePdf.DomPdf', 'engine' => 'CakePdf.Tcpdf', 'orientation' => 'portrait', 'orientation' => 'portrait', 'pageSize' => 'A4' 'pageSize' => 'A4' )); )); $pdfData = $cakePdf->output($html); $pdfData = $cakePdf->output($html);
  • 6. WHY IT WAS BUILT • And now with CakePdf // Using DomPdf // Tcpdf example App::uses('CakePdf', 'CakePdf.Pdf'); App::uses('CakePdf', 'CakePdf.Pdf'); $html = $html = '<html><body>'. '<html><body>'. '<p>Put your html here.</p>'. '<p>Put your html here.</p>'. '</body></html>'; '</body></html>'; $cakePdf = new CakePdf(array( $cakePdf = new CakePdf(array( 'engine' => 'CakePdf.DomPdf', 'engine' => 'CakePdf.Tcpdf', 'orientation' => 'portrait', 'orientation' => 'portrait', 'pageSize' => 'A4' 'pageSize' => 'A4' )); )); $pdfData = $cakePdf->output($html); $pdfData = $cakePdf->output($html);
  • 7. BUILT IN RENDER ENGINES External Binary WkHtmlToPdf stable Uses WebKit DomPdf alpha PHP Based Mpdf alpha PHP Based Tcpdf alpha PHP Based
  • 8. BUILT IN RENDER ENGINES External Binary WkHtmlToPdf stable Uses WebKit DomPdf alpha PHP Based Mpdf alpha Very Nice! PHP Based Tcpdf alpha PHP Based
  • 9. CONFIGURATION Setup Add in Config/bootstrap.php CakePlugin::load('CakePdf', array( 'bootstrap' => true, 'routes' => true )); Needs RequestHandlerComponent class AppController extends Controller { public $components = array('RequestHandler'); }
  • 10. CONFIGURATION Special case for CakePHP 2.1.x Config/bootstrap.php CakePlugin::load('CakePdf', array( 'bootstrap' => true )); Config/routes.php Router::parseExtensions('pdf');
  • 11. CONFIGURATION Settings Global settings // Config/bootstrap.php Configure::write('CakePdf', array( 'engine' => 'CakePdf.WkHtmlToPdf', 'pageSize' => 'A4', 'orientation' => 'portrait' )); Inside the controller public function view($id) { $this->pdfConfig = array( 'orientation' => 'landscape', 'download' => true, 'filename' => 'invoice-2005.pdf' ); .. Rest of action logic .. }
  • 12. TO VIEW OR NOT TO VIEW • Generating PDF files with the .pdf extension in the URL • Viewing PDF documents in the browser • Download to disk • Smaller files • Stand-alone to generate raw PDF data • Email attachments • Offline processing • Larger files
  • 13. REQUESTHANDLER FLOW View in browser or download to disk • Layout file App/View/Layout/pdf/default.ctp • View file App/View/Orders/pdf/invoice.ctp • All the CakePHP goodies to your disposal • Helpers • Blocks • Elements
  • 14. STAND-ALONE FLOW App::uses('CakePdf', 'CakePdf.Pdf'); $CakePdf = new CakePdf(array( 'engine' => 'CakePdf.Tcpdf', 'pageSize' => 'A5', 'orientation' => 'landscape', 'margin' => 10 )); $html = ' <html><head></head> <body><p>CakeFest is the best</p></body> </html>'; $rawPdfData = $CakePdf->output($html);
  • 15. ENCRYPTING PDF FILES • Protect against viewing, printing, editing and more • pdftk binary from PDFLabs • 128 bit encryption • Second pass encryption • Encrypt existing PDF documents
  • 16. PASSWORD TYPES • Owner password • Unlock protected permissions • Cannot be the same as the user password • User password • Will prompt before opening the PDF Document • Cannot exist without an owner password
  • 17. CRYPTO CONFIGURATION Add in Config/bootstrap.php //Default configuration Configure::write('CakePdf', array( 'engine' => 'CakePdf.WkHtmlToPdf', 'crypto' => 'CakePdf.Pdftk' ));
  • 18. USING ENCRYPTING //Action configuration public function view($id) { $this->pdfConfig = array( 'orientation' => 'landscape', 'protect' => true, 'userPassword' => 'foo', 'ownerPassword' => 'bar', 'permissions' => array( 'print' ) ); .. Rest of action logic .. }
  • 20. http://github.com/ceeram/CakePdf THANKS Jelle Henkens - @lemonit - jelle.henkens@gmail.com

Notes de l'éditeur

  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