看板 PHP 關於我們 聯絡資訊
兩種做法: 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
jikotw74:感謝回應 我想請問第二種方法中 哪個套件用起來會比較快? 05/21 13:53
jikotw74:原文中提到的 Zxing vs PHP QRcode 05/21 13:54
jikotw74:一個是外部執行java 一個是php class 要怎麼知道用誰好?? 05/21 13:55
MOONRAKER:Google的QR code support去年已經deprecated了。 05/21 15:10
MOONRAKER:現在還能用,他不一定幾時要拿掉 05/21 15:12
hom1130:所以local端都有套件可以自己產生(含QRcode and Barcode) 05/21 16:40
hom1130:速度我試是差不多吧~我也是拿來產生PDF印標籤 05/21 16:41
MOONRAKER:後來又看了一下,他說可以用到2015年 XP 05/21 18:55
alpe:compile 過的會比較快. api 平均來說最慢 05/21 21:06