添加此代码...
if (preg_match("/^pdf_/i", $k)) {
if (!defined($constKey)) {
define($constKey, $v);
}
}
到捆绑文件
/vendor/whiteoctober/tcpdf-bundle/WhiteOctober/TCPDFBundle/WhiteOctoberTCPDFBundle.php
原始文件https://github.com/wrep/TCPDFBundle/blob/master/WrepTCPDFBundle.php
目前仅匹配以开头的配置参数^k
此捆绑包的配置选项显示在这里
https://github.com/wrep/TCPDFBundle/blob/master/WrepTCPDFBundle.php
我不得不从 tcpdf_config.php 添加一些配置参数,这些参数没有在上面的文档配置示例中列出。这是我完整的 white_october_tcpdf: 部分app/config/config.yml
...ober_tcpdf:
file: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/tcpdf.php
class: TCPDF
tcpdf:
k_path_url: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/
k_path_main: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/
k_path_fonts: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/fonts/
k_path_cache: %kernel.cache_dir%/tcpdf
k_path_url_cache: %kernel.cache_dir%/tcpdf
k_path_images: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/examples/images/
k_blank_image: %kernel.root_dir%/../vendor/tecnick.com/tcpdf/examples/images/_blank.png
k_cell_height_ratio: 1.25
k_title_magnification: 1.3
k_small_ratio: 0.66666666666667
k_thai_topchars: true
k_tcpdf_calls_in_html: true
k_tcpdf_external_config: true
head_magnification: 10
pdf_page_format: LETTER
pdf_page_orientation: P
pdf_creator: TCPDF
pdf_author: TCPDF
pdf_header_title: Example Title
pdf_header_string: "this is motto - My Company\nwww.mycompany.org"
pdf_header_logo: ../../../../../web/bundles/home/images/peas.jpg
pdf_header_logo_width: 30
pdf_unit: mm
pdf_margin_header: 5
pdf_margin_footer: 10
pdf_margin_top: 27
pdf_margin_bottom: 25
pdf_margin_left: 15
pdf_margin_right: 15
pdf_font_name_main: helvetica
pdf_font_size_main: 10
pdf_font_name_data: helvetica
pdf_font_size_data: 8
pdf_font_monospaced: courier
pdf_image_scale_ratio: 1.25