Advertisement
Guest User

Untitled

a guest
Jun 30th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.01 KB | None | 0 0
  1. <?php
  2.  
  3. return array(
  4.  
  5.     /*
  6.     |--------------------------------------------------------------------------
  7.     | Settings
  8.     |--------------------------------------------------------------------------
  9.     |
  10.     | Set some default values. It is possible to add all defines that can be set
  11.     | in dompdf_config.inc.php. You can also override the entire config file.
  12.     |
  13.     */
  14.     'orientation' => 'portrait',
  15.     'defines' => array(
  16.         /**
  17.          * The location of the DOMPDF font directory
  18.          *
  19.          * The location of the directory where DOMPDF will store fonts and font metrics
  20.          * Note: This directory must exist and be writable by the webserver process.
  21.          * *Please note the trailing slash.*
  22.          *
  23.          * Notes regarding fonts:
  24.          * Additional .afm font metrics can be added by executing load_font.php from command line.
  25.          *
  26.          * Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
  27.          * be embedded in the pdf file or the PDF may not display correctly. This can significantly
  28.          * increase file size unless font subsetting is enabled. Before embedding a font please
  29.          * review your rights under the font license.
  30.          *
  31.          * Any font specification in the source HTML is translated to the closest font available
  32.          * in the font directory.
  33.          *
  34.          * The pdf standard "Base 14 fonts" are:
  35.          * Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
  36.          * Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
  37.          * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
  38.          * Symbol, ZapfDingbats.
  39.          */
  40.         "DOMPDF_FONT_DIR" => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)  
  41.  
  42.         /**
  43.          * The location of the DOMPDF font cache directory
  44.          *
  45.          * This directory contains the cached font metrics for the fonts used by DOMPDF.
  46.          * This directory can be the same as DOMPDF_FONT_DIR
  47.          *
  48.          * Note: This directory must exist and be writable by the webserver process.
  49.          */
  50.         "DOMPDF_FONT_CACHE" => storage_path('fonts/'),
  51.  
  52.         /**
  53.          * The location of a temporary directory.
  54.          *
  55.          * The directory specified must be writeable by the webserver process.
  56.          * The temporary directory is required to download remote images and when
  57.          * using the PFDLib back end.
  58.          */
  59.         "DOMPDF_TEMP_DIR" => sys_get_temp_dir(),
  60.  
  61.         /**
  62.          * ==== IMPORTANT ====
  63.          *
  64.          * dompdf's "chroot": Prevents dompdf from accessing system files or other
  65.          * files on the webserver.  All local files opened by dompdf must be in a
  66.          * subdirectory of this directory.  DO NOT set it to '/' since this could
  67.          * allow an attacker to use dompdf to read any files on the server.  This
  68.          * should be an absolute path.
  69.          * This is only checked on command line call by dompdf.php, but not by
  70.          * direct class use like:
  71.          * $dompdf = new DOMPDF();  $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
  72.          */
  73.         "DOMPDF_CHROOT" => realpath(base_path()),
  74.  
  75.         /**
  76.          * Whether to use Unicode fonts or not.
  77.          *
  78.          * When set to true the PDF backend must be set to "CPDF" and fonts must be
  79.          * loaded via load_font.php.
  80.          *
  81.          * When enabled, dompdf can support all Unicode glyphs. Any glyphs used in a
  82.          * document must be present in your fonts, however.
  83.          */
  84.         "DOMPDF_UNICODE_ENABLED" => true,
  85.  
  86.         /**
  87.          * Whether to enable font subsetting or not.
  88.          */
  89.         "DOMPDF_ENABLE_FONTSUBSETTING" => false,
  90.  
  91.         /**
  92.          * The PDF rendering backend to use
  93.          *
  94.          * Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
  95.          * 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
  96.          * fall back on CPDF. 'GD' renders PDFs to graphic files. {@link
  97.          * Canvas_Factory} ultimately determines which rendering class to instantiate
  98.          * based on this setting.
  99.          *
  100.          * Both PDFLib & CPDF rendering backends provide sufficient rendering
  101.          * capabilities for dompdf, however additional features (e.g. object,
  102.          * image and font support, etc.) differ between backends.  Please see
  103.          * {@link PDFLib_Adapter} for more information on the PDFLib backend
  104.          * and {@link CPDF_Adapter} and lib/class.pdf.php for more information
  105.          * on CPDF. Also see the documentation for each backend at the links
  106.          * below.
  107.          *
  108.          * The GD rendering backend is a little different than PDFLib and
  109.          * CPDF. Several features of CPDF and PDFLib are not supported or do
  110.          * not make any sense when creating image files.  For example,
  111.          * multiple pages are not supported, nor are PDF 'objects'.  Have a
  112.          * look at {@link GD_Adapter} for more information.  GD support is
  113.          * experimental, so use it at your own risk.
  114.          *
  115.          * @link http://www.pdflib.com
  116.          * @link http://www.ros.co.nz/pdf
  117.          * @link http://www.php.net/image
  118.          */
  119.         "DOMPDF_PDF_BACKEND" => "CPDF",
  120.        
  121.         /**
  122.          * PDFlib license key
  123.          *
  124.          * If you are using a licensed, commercial version of PDFlib, specify
  125.          * your license key here.  If you are using PDFlib-Lite or are evaluating
  126.          * the commercial version of PDFlib, comment out this setting.
  127.          *
  128.          * @link http://www.pdflib.com
  129.          *
  130.          * If pdflib present in web server and auto or selected explicitely above,
  131.          * a real license code must exist!
  132.          */
  133.         //"DOMPDF_PDFLIB_LICENSE" => "your license key here",
  134.  
  135.         /**
  136.          * html target media view which should be rendered into pdf.
  137.          * List of types and parsing rules for future extensions:
  138.          * http://www.w3.org/TR/REC-html40/types.html
  139.          *   screen, tty, tv, projection, handheld, print, braille, aural, all
  140.          * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
  141.          * Note, even though the generated pdf file is intended for print output,
  142.          * the desired content might be different (e.g. screen or projection view of html file).
  143.          * Therefore allow specification of content here.
  144.          */
  145.         "DOMPDF_DEFAULT_MEDIA_TYPE" => "screen",
  146.  
  147.         /**
  148.          * The default paper size.
  149.          *
  150.          * North America standard is "letter"; other countries generally "a4"
  151.          *
  152.          * @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
  153.          */
  154.         "DOMPDF_DEFAULT_PAPER_SIZE" => "a4",
  155.  
  156.         /**
  157.          * The default font family
  158.          *
  159.          * Used if no suitable fonts can be found. This must exist in the font folder.
  160.          * @var string
  161.          */
  162.         "DOMPDF_DEFAULT_FONT" => "serif",
  163.  
  164.         /**
  165.          * Image DPI setting
  166.          *
  167.          * This setting determines the default DPI setting for images and fonts.  The
  168.          * DPI may be overridden for inline images by explictly setting the
  169.          * image's width & height style attributes (i.e. if the image's native
  170.          * width is 600 pixels and you specify the image's width as 72 points,
  171.          * the image will have a DPI of 600 in the rendered PDF.  The DPI of
  172.          * background images can not be overridden and is controlled entirely
  173.          * via this parameter.
  174.          *
  175.          * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
  176.          * If a size in html is given as px (or without unit as image size),
  177.          * this tells the corresponding size in pt.
  178.          * This adjusts the relative sizes to be similar to the rendering of the
  179.          * html page in a reference browser.
  180.          *
  181.          * In pdf, always 1 pt = 1/72 inch
  182.          *
  183.          * Rendering resolution of various browsers in px per inch:
  184.          * Windows Firefox and Internet Explorer:
  185.          *   SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
  186.          * Linux Firefox:
  187.          *   about:config *resolution: Default:96
  188.          *   (xorg screen dimension in mm and Desktop font dpi settings are ignored)
  189.          *
  190.          * Take care about extra font/image zoom factor of browser.
  191.          *
  192.          * In images, <img> size in pixel attribute, img css style, are overriding
  193.          * the real image dimension in px for rendering.
  194.          *
  195.          * @var int
  196.          */
  197.         "DOMPDF_DPI" => 96,
  198.  
  199.         /**
  200.          * Enable inline PHP
  201.          *
  202.          * If this setting is set to true then DOMPDF will automatically evaluate
  203.          * inline PHP contained within <script type="text/php"> ... </script> tags.
  204.          *
  205.          * Enabling this for documents you do not trust (e.g. arbitrary remote html
  206.          * pages) is a security risk.  Set this option to false if you wish to process
  207.          * untrusted documents.
  208.          *
  209.          * @var bool
  210.          */
  211.         "DOMPDF_ENABLE_PHP" => false,
  212.  
  213.         /**
  214.          * Enable inline Javascript
  215.          *
  216.          * If this setting is set to true then DOMPDF will automatically insert
  217.          * JavaScript code contained within <script type="text/javascript"> ... </script> tags.
  218.          *
  219.          * @var bool
  220.          */
  221.         "DOMPDF_ENABLE_JAVASCRIPT" => true,
  222.  
  223.         /**
  224.          * Enable remote file access
  225.          *
  226.          * If this setting is set to true, DOMPDF will access remote sites for
  227.          * images and CSS files as required.
  228.          * This is required for part of test case www/test/image_variants.html through www/examples.php
  229.          *
  230.          * Attention!
  231.          * This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and
  232.          * allowing remote access to dompdf.php or on allowing remote html code to be passed to
  233.          * $dompdf = new DOMPDF(, $dompdf->load_html(...,
  234.          * This allows anonymous users to download legally doubtful internet content which on
  235.          * tracing back appears to being downloaded by your server, or allows malicious php code
  236.          * in remote html pages to be executed by your server with your account privileges.
  237.          *
  238.          * @var bool
  239.          */
  240.         "DOMPDF_ENABLE_REMOTE" => true,
  241.  
  242.         /**
  243.          * A ratio applied to the fonts height to be more like browsers' line height
  244.          */
  245.         "DOMPDF_FONT_HEIGHT_RATIO" => 1.1,
  246.  
  247.         /**
  248.          * Enable CSS float
  249.          *
  250.          * Allows people to disabled CSS float support
  251.          * @var bool
  252.          */
  253.         "DOMPDF_ENABLE_CSS_FLOAT" => true,
  254.  
  255.  
  256.         /**
  257.          * Use the more-than-experimental HTML5 Lib parser
  258.          */
  259.         "DOMPDF_ENABLE_HTML5PARSER" => false,
  260.  
  261.  
  262.     ),
  263.  
  264.  
  265. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement