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条)

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型