dousi1970 2012-04-18 15:22
浏览 95
已采纳

DOMPDF安装选项

I'm working on installing dompdf http://code.google.com/p/dompdf/

It's going well, but the installation instructions are telling me to "edit dompdf_config.custom.inc.php (in version 0.6) or dompdf_config.inc.php (version 0.5) to fit your installation." I am not sure what lines I am supposed to uncomment. I am using it on an Ubuntu Server (10.04) with the generic lamp stack, intending to code in PHP.

Has anyone used this that can at least explain (at least some of) what the different options are.

<?php 
//define("DOMPDF_TEMP_DIR", "/tmp");
//define("DOMPDF_CHROOT", DOMPDF_DIR);
//define("DOMPDF_UNICODE_ENABLED", false);
//define("DOMPDF_PDF_BACKEND", "PDFLib");
//define("DOMPDF_DEFAULT_MEDIA_TYPE", "print");
//define("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
//define("DOMPDF_DEFAULT_FONT", "serif");
//define("DOMPDF_DPI", 72);
//define("DOMPDF_ENABLE_PHP", true);
//define("DOMPDF_ENABLE_REMOTE", true);
//define("DOMPDF_ENABLE_CSS_FLOAT", true);
//define("DOMPDF_ENABLE_JAVASCRIPT", false);
//define("DEBUGPNG", true);
//define("DEBUGKEEPTEMP", true);
//define("DEBUGCSS", true);
//define("DEBUG_LAYOUT", true);
//define("DEBUG_LAYOUT_LINES", false);
//define("DEBUG_LAYOUT_BLOCKS", false);
//define("DEBUG_LAYOUT_INLINE", false);
//define("DOMPDF_FONT_HEIGHT_RATIO", 1.0);
//define("DEBUG_LAYOUT_PADDINGBOX", false);
//define("DOMPDF_LOG_OUTPUT_FILE", DOMPDF_FONT_DIR."log.htm");
//define("DOMPDF_ENABLE_HTML5PARSER", true);
//define("DOMPDF_ENABLE_FONTSUBSETTING", true);

// DOMPDF authentication
//define("DOMPDF_ADMIN_USERNAME", "user");
//define("DOMPDF_ADMIN_PASSWORD", "password");
  • 写回答

2条回答 默认 最新

  • douhu2890 2012-04-19 02:10
    关注

    You don't need to edit any of the settings to start using dompdf. All of the settings have defaults, and dompdf may work right out of the box. All the settings are explained in dompdf_config.inc.php, and this is also where the defaults are set. But here's a quick list of the setting to pay the most attention to:

    • DOMPDF_TEMP_DIR : dompdf uses this directory for image handling and temporary storage of remote content. The process under which dompdf is running should have read/write access. Default = sys_get_temp_dir()
    • DOMPDF_CHROOT : If you're using $dompdf->load_html_file() to load a file from the local file system it needs to be under the directory specified in this setting. Default = dompdf installation directory
    • DOMPDF_UNICODE_ENABLED : Does your document use a language other than English? If so this should be true, and you should read the Unicode How-to. Default = true.
    • DOMPDF_ENABLE_PHP : using inline script? If not or if you don't know what that means set this to false. Default = false.
    • DOMPDF_ENABLE_REMOTE : Are you loading documents using a full URL with domain? Do you reference images/stylesheets using a full URL with domain? Set this to true. Default = false.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误