Symfony sfTCPDF 插件 writeHTML 错误
我正在使用 symfony 1.3,sfTCPDF 插件,当我使用curl 执行返回 html 内容时,tcpdf 抛出错误
这是我的代码
$url = "http://urlpath/builder/builder_dev.php/design/agreement?";
$arguments = "&pdfid=10";
$ch1 = curl_init();
$headerinfo = apache_request_headers();
curl_setopt($ch1, CURLOPT_URL, $url);
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, $arguments);
curl_setopt($ch1, CURLOPT_USERAGENT,$headerinfo['User-Agent']);
$result = curl_exec($ch1);
$pdf->writeHTML("\n\n\n".$result, true, 0);
$pdf->Output('Agreement.pdf');
当我运行页面时,它显示 mnay 警告消息,第一个
Warning: imagepng() [function.imagepng]: Unable to open '/var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/cache/mska_01754b01ec8372f7001557e3be56ba40' for writing: No such file or directory in /var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/tcpdf.php on line 8109
基于它显示其他警告的文件, 错误
TCPDF ERROR: Can't open image file: /var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/cache/mska_01754b01ec8372f7001557e3be56ba40
Notice: Undefined property: sfTCPDF::$userData in /var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/sfTCPDF.class.php on line 112
这是我看到路径
/var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/cache/
没有缓存文件夹的 。我给了整个项目文件夹777权限。尽管最终会出现这个错误。
I'm using symfony 1.3, sfTCPDF plugin when i return a html content using curl execution tcpdf is throwing error
Here is my code
$url = "http://urlpath/builder/builder_dev.php/design/agreement?";
$arguments = "&pdfid=10";
$ch1 = curl_init();
$headerinfo = apache_request_headers();
curl_setopt($ch1, CURLOPT_URL, $url);
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, $arguments);
curl_setopt($ch1, CURLOPT_USERAGENT,$headerinfo['User-Agent']);
$result = curl_exec($ch1);
$pdf->writeHTML("\n\n\n".$result, true, 0);
$pdf->Output('Agreement.pdf');
When i run the page it shows mnay warning messages first one is
Warning: imagepng() [function.imagepng]: Unable to open '/var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/cache/mska_01754b01ec8372f7001557e3be56ba40' for writing: No such file or directory in /var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/tcpdf.php on line 8109
based on the file it shows other warnings and
Here is the error
TCPDF ERROR: Can't open image file: /var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/cache/mska_01754b01ec8372f7001557e3be56ba40
Notice: Undefined property: sfTCPDF::$userData in /var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/sfTCPDF.class.php on line 112
I saw the path
/var/www/html/projectPath/plugins/sfTCPDFPlugin/lib/tcpdf/cache/
There is no cache folder. I gave 777 permission to the entire project folder. Eventhough it ends up with this error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎这是在处理同一个问题:
http://anthologize.org/trac/ticket/125
TCPDF 没有添加目录,所以我认为你只需要在旧版本中手动创建它(现在可能已经修复)。
Seems this is dealing with the same issue:
http://anthologize.org/trac/ticket/125
TCPDF wasn't adding the dir, so I think you just need to manually create it in older versions (this might be fixed by now).