开发者

Symfony sfTCPDF plugin writeHTML error

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜