作者hom1130 (.拨云见日.)
看板PHP
标题Re: [请益] QR code image generator and decoder
时间Tue May 21 13:21:13 2013
两种做法:
1.Google Api
$url = urlencode("1234");
$image = imagecreatefrompng("
http://chart.apis.google.com/chart?cht=qr&chs=120x120&chl=$url");
imagepng($image, "file.png");
$pdf->Image("file.png", 56, 3 , 8, 8);
用google api产生图档套PDF
2.用套件(QRcode或barcode套件)产生
$url = urlencode("TEST 1234");
$image = imagecreatefrompng("
http://localhost/barcode/html/image.php?code=code39&o=1&t=30&r=1&f=2&a1=&a2=&text=$url");
imagepng($image, "file.png");
$pdf->Image("file.png", 52, 3 , 12, 6);
在local端用套件产生图档套PDF
Barcode:
http://codeslibrary.net/sc.php?id=7613&code=Barcode%20Generator
QRcode:
http://phpqrcode.sourceforge.net/#home
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.249.38.187
1F:推 jikotw74:感谢回应 我想请问第二种方法中 哪个套件用起来会比较快? 05/21 13:53
2F:→ jikotw74:原文中提到的 Zxing vs PHP QRcode 05/21 13:54
3F:→ jikotw74:一个是外部执行java 一个是php class 要怎麽知道用谁好?? 05/21 13:55
4F:→ MOONRAKER:Google的QR code support去年已经deprecated了。 05/21 15:10
5F:→ MOONRAKER:现在还能用,他不一定几时要拿掉 05/21 15:12
6F:→ hom1130:所以local端都有套件可以自己产生(含QRcode and Barcode) 05/21 16:40
7F:→ hom1130:速度我试是差不多吧~我也是拿来产生PDF印标签 05/21 16:41
8F:→ MOONRAKER:後来又看了一下,他说可以用到2015年 XP 05/21 18:55
9F:推 alpe:compile 过的会比较快. api 平均来说最慢 05/21 21:06