Exemple #1
0
        ////////////////////////////////////////////////////////////////////
        // Draw Barcode
        ////////////////////////////////////////////////////////////////////

        private void DrawBarcode()
        {
            // save graphics state
            Contents.SaveGraphicsState();
            //string barcode = PdfPassJson.Barcode.Message;
            string    barcode = pk.Barcode.Message;
            PdfQRCode QRCode  = new PdfQRCode(Document, barcode, ErrorCorrection.M);

            Contents.DrawQRCode(QRCode, 1.75, 0.5, 5);
            Contents.DrawText(ArialNormal, 24, 4.25, 0.7, TextJustify.Center, barcode);

            // restore graphics sate
            Contents.RestoreGraphicsState();
            return;
        }
Exemple #2
0
        ////////////////////////////////////////////////////////////////////
        // Draw Barcode
        ////////////////////////////////////////////////////////////////////

        private void DrawBarcode()
        {
            // save graphics state
            Contents.SaveGraphicsState();

            BarcodeEAN13 Barcode1 = new BarcodeEAN13("1234567890128");

            Contents.DrawBarcode(1.3, 7.05, 0.012, 0.75, Barcode1, ArialNormal, 8.0);

            PdfQRCode QRCode = new PdfQRCode(Document, "http://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library-Version", ErrorCorrection.M);

            Contents.DrawQRCode(QRCode, 6.0, 6.8, 1.2);

            // define a web link area coinsiding with the qr code
            Page.AddWebLink(6.0, 6.8, 7.2, 8.0, "http://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library-Version");

            // restore graphics sate
            Contents.RestoreGraphicsState();
            return;
        }