Smarty:从html / php创建png图像

时间:2015-11-17 09:41:19

标签: php html image smarty smarty2

我正在使用Smarty构建带有引号的文章布局,使用webfonts设置样式。我想为电子邮件客户端创建一个并行布局,它自动包含拉引号的png版本。

有没有办法根据我用来格式化文章布局的拉引号的代码片段将png图像写入文件,就像我从Smarty模板编写html文件一样?

这是我的代码段:

<p class="quote" style="width:720px; color: #ff0066;font-family: {$quotes.0.fontfamily};font-size: {$quotes.0.size}px;text-indent: -12px; margin: 0 20px 0.5em 20px;">{$quotes.0.quote}</p>

这就是我想象输出可能起作用的方式:

// get output 
$output = $smarty->fetch('quote-image.tpl'); 
// write png image file
$file = $quotes["filename"].'.png';
file_put_contents($file,$output); 

但显然不是那么简单!

0 个答案:

没有答案
相关问题