【发布时间】:2013-04-16 07:23:12
【问题描述】:
我想显示来自 url 的二维码。我尝试了这个,但那不起作用,我认为我的代码没有将 url 保存在我的计算机上,他失败了,他尝试打开 qrcode
$imageUrl = 'https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=toto';
$imagePath = sys_get_temp_dir() . '\\' . basename($imageUrl);
file_put_contents($imagePath, file_get_contents($imageUrl));
$image = Zend_Pdf_Image::imageWithPath($imagePath);
unlink($imagePath);
$page = $this->newPage($settings);
$page->drawImage($image, 0, 842 - 153, 244, 842);
谢谢
【问题讨论】:
-
请在描述问题时更加具体,以增加获得帮助的机会。仅仅
didn't work的描述性不是很好。 -
你检查过你的
temp_dir看看里面有没有什么东西吗?