RPDF417x ActiveX

Copyright J4L (http://www.java4less.com) 2006.

Introduction

RPDF417 is an ActiveX that will allow you to create PDF417 barcodes for you windows applications.

PDF stands for “Portable Data File.” A two-dimensional symbology (2D), a single PDF417 symbol carries up to 1.1 kilobytes of machine-readable data in a space no larger than a standard bar code. And, unlike one-dimensional bar codes (1D), which are just a key linked to a database, PDF417 symbols contain the database itself. That means, you don't have to store an article number in the barcode but you can also store the name , the size , the color, the name of the manufacturer etc...


Installation

 

 

After unzipping the file you have received or downloaded, the activeX needs to be registered in your windows environment by executing the install.bat file. On windows 7 you must right click the bat file and run it as administrator.

If you want to deinstall the OCX you can do it by means of uninstall.bat.

Boths programs just run the regsvr32.exe windows tool in order to register and unregister OCX's.

The ActiveX has been developed using Visual Basic 6.0. For this reason it needs the following files:

  1. the OCX needs the file Msvbvm60.dll. Make sure the file is available at your PC.
  2. If you use the OCX in other development environment different from Visual Basic, you will also need the file Msstkprp.dll.
Let us know if you need any of these files.
 
 

Examples

The product contains the following example:

Visual Basic

In the subdirectory Examples/VB you will find a visual basic 6.0 project you can use to test the ActiveX. The project is already compiled, you can execute it by means of examplePDF417.exe.

 

Use with MSAccess

The ActiveX can be inserted into your MSAccess forms and reports. If want to retrieve a value from the database before you create the barcode you can do it this way:

  1. Place an invisitble text box in the detail band where the barcode resides, and set its Control Source to the approiate field in the database.
  2. In the detail_format event of the report (or form), place the following code: me!NameOfBarCodeControl.pdfCode=me!MyControlsName

 

Use with ASP

The ActiveX can also be used in your web applications when you use ASP. The following code shows how this can be done:

<%@ LANGUAGE="VBSCRIPT" %>
<%

set bc=server.createobject("RPDF417.RPDF417X")
bc.standalone=true
bc.pdfcode=98765432
bc.saveToBMP("c:\inetpub\wwwroot\barcode")
set bc=nothing

<HTML>
<BODY>
RBARCODEX<BR>
<img src="barcode.bmp">
</BODY>
</HTML>

this script uses RPDF417X in order to create a bmp image that can be display in the browser. If you want to use another format (not BMP) you can use external tools for the conversion. The following example uses the JanGraphics freeware library to convert the bmp to a png file:

<%@ LANGUAGE="VBSCRIPT" %>
<%

set bc=server.createobject("RPDF417.RPDF417X")
bc.standalone=true
bc.pdfcode=98765432
bc.saveToBMP("c:\inetpub\wwwroot\barcode")
set bc=nothing

set conv=createobject("janGraphics.Compendium")
conv.convert "c:\inetpub\wwwroot\barcode.bmp","c:\inetpub\wwwroot\barcode.png"
set conv=nothin
g
%>

 

 

Properties and methods

The activeX RPDF417.ocx has following properties and methods:

Methods

Properties

Macro PDF 417

The Macro PDF 417 symbology allows you to encode large amount of data by splitting it into several symbols (segments).   The following properties and methods can be used to create Macro PDF 417 barcodes in Macro version of the activeX.

Methods

Properties

Macro PDF barcodes can be created in 2 ways:

  1. Automatic creation. You let the control calculate the number of segments:

    barcode.pdfcode="valuetoencode";
    Dim a(0 To 2) As Integer ' identifier will be 123
    a(0) = 1
    a(1) = 2
    a(2) = 3
    barcode.PDFMacroFileId = fileid
    barcode.PDFRows = 5
    barcode.PDFMaxRows = 30

    barcode.resetMacroPDF

    ' calculate number of segments and split the value
    barcode.prepareMacroPDF

    ' paint each segment
    for i=0 to barcode.PDFMacroSegmentCount-1
    barcode.PDFMacroSegment =i
    ' paint
    barcode.saveToBMP "segment" & i & ".bmp"
    next

  2. Manual creation. If you know the number of segments you need you can split the data yourself:


    Dim a(0 To 2) As Integer
    a(0) = 1
    a(1) = 2
    a(2) = 3
    barcode.PDFMacroFileId = fileid
    barcode.PDFRows = 5
    barcode.PDFMaxRows = 30
    barcode.PDFMacroSegmentCount=2 ' we will create 2 segments

    'paint segment 1
    barcode.pdfcode="valuetoencode_part1"; ' the value to encode must be splitted in 2 parts
    barcode.PDFMacroSegment =0 ' first segment
    barcode.saveToBMP "segment0.bmp"

    'paint segment 2
    barcode.pdfcode="valuetoencode_part2";
    barcode.PDFMacroSegment =1 ' secodn and las segment
    barcode.PDFMacroLastSegment =true
    barcode.saveToBMP "segment1.bmp"