顯示廣告
隱藏 ✕
※ 本文為 dinos 轉寄自 ptt.cc 更新時間: 2013-05-21 14:06:09
看板 PHP
作者 hom1130 (.撥雲見日.)
標題 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"%29;
[圖]
 
        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"%29;
        imagepng($image, "file.png");
        $pdf->Image("file.png", 52, 3 , 12, 6);

在local端用套件產生圖檔套PDF

Barcode:http://codeslibrary.net/sc.php?id=7613&code=Barcode Generator

QRcode:http://phpqrcode.sourceforge.net/#home
PHP QR Code - QR code generator, an LGPL PHP library
PHP QR code is Open Source (LGPL) generator for 2-D QR barcode, supports PNG export of code and TCPDF bindings ...
 



--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.249.38.187
jikotw74:感謝回應 我想請問第二種方法中 哪個套件用起來會比較快?1F 05/21 13:53
jikotw74:原文中提到的 Zxing vs PHP QRcode
jikotw74:一個是外部執行java 一個是php class 要怎麼知道用誰好??

--
※ 看板: dinos 文章推薦值: 0 目前人氣: 0 累積人氣: 186 
guest
x)推文 r)回覆 e)編輯 d)刪除 M)收藏 ^x)轉錄 同主題: =)首篇 [)上篇 ])下篇