向PDF文件添加QRcode二维码
首先在VS2013新建C#的Windows Form应用程序,并向窗体添加两个button控件、一个Picturebox控件。
1 实现生成QRcode二维码图像。
1)添加引用zxing.dll文件,并且添加相应2条using语句。
2)添加代码如下。
using System;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
usingSystem.Threading.Tasks;
usingSystem.Windows.Forms;
usingcom.google.zxing.qrcode; //QRcode操作库
usingcom.google.zxing.common; //QRcode操作库
namespacecsdnPDFQRcode20150408
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.Image= GenQRBarcodeImg("StringstrQRBarContent",200, 200, "BarCodeType"</