⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 barcodes.dpr

📁 生成PDF文档的控件
💻 DPR
字号:
{*******************************************************}
{                                                       }
{       This unit is part of the VISPDF VCL library.    }
{       Written by R.Husske - ALL RIGHTS RESERVED.      }
{                                                       }
{       Copyright (C) 2000-2008, www.vispdf.com         }
{                                                       }
{       e-mail: support@vispdf.com                      }
{       http://www.vispdf.com                           }
{                                                       }
{*******************************************************}

program Barcodes;
{$APPTYPE CONSOLE}
uses
  SysUtils,
  Graphics,
  Classes,
  VPDFDoc;

var
   I, H: Integer;
   VPDF: TVPDF;

const
  Names: array[0..21] of string =
  (
    'Code 25 Interleaved',
    'Code 25 Industrial',
    'Code 25 Matrix',
    'Code39',
    'Code39 Extended',
    'Code128A',
    'Code128B',
    'Code128C',
    'Code93',
    'Code93 Extended',
    'MSI',
    'PostNet',
    'Codebar',
    'EAN8',
    'EAN13',
    'UPC_A',
    'UPC_E0',
    'UPC_E1',
    'UPC Supp2',
    'UPC Supp5',
    'EAN128A',
    'EAN128B'
    );

begin
  VPDF:= TVPDF.Create(nil);
  try
    VPDF.AutoLaunch := true;              // PDF file will be shown automatically
    VPDF.FileName := '.\Barcodes.pdf';    // Set PDF filename
    VPDF.BeginDoc;                        // Create PDF file
    for I := 0 to 7 do
    begin
        for H := 0 to 2 do
        begin
            if ((I * 3) + H) > 21 then Break;

            VPDF.CurrentPage.DrawBarcode( TVPDFBarcodeType((I * 3) + H),    // Draw Black barcode
                                          H * 266 + 67, I * 133 + 69,       // on the white background
                                          50, 1, 0, '12345', true, 0, clWhite );             // 12345

            VPDF.CurrentPage.TextOut( H * 200 + 50, I * 100 + 35, 0, Names[(I * 3) + H] );   // Print barcode name

        end;
    end;
    VPDF.EndDoc;                         // Close PDF file
  finally
      VPDF.Free;
  end;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -