source-class-Com.Tecnick.Pdf.Page.Mode

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
 1: <?php
 2: /**
 3:  * Mode.php
 4:  *
 5:  * @since       2011-05-23
 6:  * @category    Library
 7:  * @package     PdfPage
 8:  * @author      Nicola Asuni <info@tecnick.com>
 9:  * @copyright   2011-2015 Nicola Asuni - Tecnick.com LTD
10:  * @license     http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
11:  * @link        https://github.com/tecnickcom/tc-lib-pdf-page
12:  *
13:  * This file is part of tc-lib-pdf-page software library.
14:  */
15: 
16: namespace Com\Tecnick\Pdf\Page;
17: 
18: /**
19:  * Com\Tecnick\Pdf\Page\Mode
20:  *
21:  * @since       2011-05-23
22:  * @category    Library
23:  * @package     PdfPage
24:  * @author      Nicola Asuni <info@tecnick.com>
25:  * @copyright   2011-2015 Nicola Asuni - Tecnick.com LTD
26:  * @license     http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
27:  * @link        https://github.com/tecnickcom/tc-lib-pdf-page
28:  */
29: abstract class Mode extends \Com\Tecnick\Pdf\Page\Format
30: {
31:     /**
32:      * Map layouts with their canonical names
33:      *
34:      * @var array
35:      */
36:     protected static $layout = array(
37:         'singlepage'     => 'SinglePage',     // Display one page at a time
38:         'default'        => 'SinglePage',
39:         'single'         => 'SinglePage',
40:         'onecolumn'      => 'OneColumn',      // Display the pages in one column
41:         'continuous'     => 'OneColumn',
42:         'twocolumnleft'  => 'TwoColumnLeft',  // Display the pages in two columns, with odd-numbered pages on the left
43:         'two'            => 'TwoColumnLeft',
44:         'twocolumnright' => 'TwoColumnRight', // Display the pages in two columns, with odd-numbered pages on the right
45:         'twopageleft'    => 'TwoPageLeft',    // Display the pages two at a time, with odd-numbered pages on the left
46:         'twopageright'   => 'TwoPageRight'    // Display the pages two at a time, with odd-numbered pages on the right
47:     );
48: 
49:     /**
50:      * Map display modes with their canonical names
51:      *
52:      * @var array
53:      */
54:     protected static $display = array(
55:         'usenone'        => 'UseNone',        // Neither document outline nor thumbnail images visible
56:         'useoutlines'    => 'UseOutlines',    // Document outline visible
57:         'usethumbs'      => 'UseThumbs',      // Thumbnail images visible
58:         'fullscreen'     => 'FullScreen',     // Full-screen mode, with no menu bar or window controls
59:         'useoc'          => 'UseOC',          // (PDF 1.5) Optional content group panel visible
60:         'useattachments' => 'UseAttachments', // (PDF 1.6) Attachments panel visible
61:         ''               => 'UseAttachments'  // (PDF 1.6) Attachments panel visible
62:     );
63:     
64:     /**
65:      * Get the canonical page layout name.
66:      *
67:      * @param string $name Page layout name
68:      *
69:      * @return string Canonical page layout name.
70:      */
71:     public function getLayout($name = '')
72:     {
73:         $name = strtolower($name);
74:         if (isset(self::$layout[$name])) {
75:             return self::$layout[$name];
76:         }
77:         return 'SinglePage';
78:     }
79: 
80:     /**
81:      * Get the canonical page display mode.
82:      *
83:      * @param string $mode A name object specifying how the document should be displayed when opened.
84:      *
85:      * @return string Canonical page display mode
86:      */
87:     public function getDisplay($mode = '')
88:     {
89:         $mode = strtolower($mode);
90:         if (isset(self::$display[$mode])) {
91:             return self::$display[$mode];
92:         }
93:         return 'UseNone';
94:     }
95: }
96: 
 

© 2004-2017 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy