作者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