Menu

PDF417 in Internet and Web

Internet and Web Page PDF417 FAQ

How to get PDF417 barcodes over the Internet?

What browsers can show web pages with barcodes?

I use your PDF417 ActiveX on the client side (in MS Internet Explorer). But I cannot make X-dimension equal to 0.6 mm. How can I solve this problem?

I use your PDF417 bar code control in ASP code. I would like to know if it is possible to save an image to the disk, for instance, as pdf417.gif?



How to get PDF417 bar codes over the Internet

There are two ways to use barcodes in web pages. They can be created either on the client side or on the server side.
Client Side Barcodes
You should install PDF417-ActiveX on each PC where you need to use it. In this case, you do not need to install anything on the server. There can be no server at all; web pages can be stored on your PC in this case. An example of such use is given here.
Create the PDF417 barcodes in the Internet Explorer

Advantages and disadvantages of creating barcodes on the client side:

Advantages:
  • Any web server can be used with any OS (Windows, Linux, etc.). Or there can be no server at all; the HTML page can be stored on the client PC in this case.
  • The load on the server is lower as barcodes are generated on the client side.
  • Client-side scripting languages (JavaScript, VB Script) can be used to control PDF417-ActiveX
  • Only a small amount of data is transmitted because there is no need to send barcode images.
  • PDF417-ActiveX can be used not only in Internet Explorer, but also in other applications (Excel, Word, Access, VC, VB, Delphi, etc.).
Disadvantages:
  • PDF417-ActiveX needs to be installed on each client PC. Such installation can be avoided, but PDF417 ActiveX must be available for downloading from the Internet in the form of a CAB file then.
  • Only Internet Explorer 4.0 (or higher) or browsers compatible with it can be used.
See also:
How to add a PDF417 ActiveX to Internet Explorer

Server Side PDF417 Barcodes
There are two ways to create barcodes on the server side.

1. The first way (see the picture below) is to use the SaveToImageFile method. In this case, a barcode is saved to a file of the JPEG, GIF, PNG or BMP format. After that the path to that file is specified in the HTML page, the Internet browser loads it and displays this image.

Create the PDF417 barcodes in an IIS (Internet Information Server)

2. The second way is to use the BinaryWritePicture method. No intermediate files are created in this case and the image is sent to the client PC in the form of a byte array. This method seems to be more preferable because there is no need to control the process of creating/deleting files, give rights for accessing files, control their deletion, etc. Plus the load on the web server is lower.

Create the PDF417 barcodes in an IIS (Internet Information Server) without any files

Advantages and disadvantages of creating barcodes on the server side:

Advantages:
  • There is no need to install any additional plug-ins on the client side. That is why it is easier to deploy a web application and maintain it.
  • Any web browser (not only Internet Explorer) can be used.
Disadvantages:
  • Only IIS (Internet Information Server) or servers compatible with it can be used as the web server.
  • The load on the web server is higher as barcodes are generated on the server.
  • The amount of data transmitted over the Internet is larger because whole barcode images are sent.
See also:
How to use PDF417 ActiveX on an IIS server


What browsers can show web pages with barcodes?

The answer to this question depends on the variant selected for creating barcodes – client-side or server-side. If it is client-side, only Internet Explorer 4.0 (or higher) can display barcodes. If it is server-side, any Internet browser capable of displaying JPEG, GIF, PNG or BMP files can display barcodes.


I use your PDF417 ActiveX on the client side (in MS Internet Explorer). You can see my HTML file below:

<html>
<body>
<OBJECT ID="PDF417Ctrl" WIDTH="260" HEIGHT="150" CLASSID="CLSID:B26FE0A3-C7AD-4DD3-B9E7-BC6524112444">
<PARAM NAME="DataToEncode" VALUE="1234567">
<PARAM NAME="CompactionMode" VALUE="0">
</OBJECT>
</body>
</html>
But I cannot make X-dimension equal to 0.6 mm. How can I solve this problem?

If you use our PDF417-ActiveX in Internet Explorer, you can specify the PDF417 X-dimension absolutely precisely. You should use the GetPDF417Width and GetPDF417Height methods for that. This methods calculate the PDF417 barcode width and height and uses JavaScript code to write this values to HTML. You can see the HTML code of such a page below.
<html>
<body>

<SCRIPT LANGUAGE="JavaScript">
var pdf417 = new ActiveXObject("PDF417ActiveX.PDF417Ctrl.1");
pdf417.DataToEncode = "1234567";
pdf417.CompactionMode = 0;
pdf417Width = pdf417.GetPDF417Width(0.6, 600, 600, 2, 2);
pdf417Height = pdf417.GetPDF417Height(0.6, 600, 600, 2, 2);

document.write( "<OBJECT ID=\"PDF417Ctrl\" CLASSID=\"CLSID:B26FE0A3-C7AD-4DD3-B9E7-BC6524112444\" style=\"width: ", pdf417Width, "mm; height: ", pdf417Height, "mm\">" );
</SCRIPT>

<PARAM NAME="DataToEncode" VALUE="1234567">
<PARAM NAME="CompactionMode" VALUE="0">
</OBJECT>
</body>
</html>
While using this HTML code, do not forget to change the printer resolution. You can do it in the following lines:
pdf417Width = pdf417.GetPDF417Width(0.6, 600, 600, 2, 2);
pdf417Height = pdf417.GetPDF417Height(0.6, 600, 600, 2, 2);
where 600x600 dpi is a printer resolution, 0.6 is x-dimension.





I use your PDF417 bar code control in ASP code. I would like to know if it is possible to save an image to the disk, for instance, as pdf417.gif?

Sure, it is. You can use any properties and methods. Thus, you should use the SaveToImageFile method to save a barcode image.
<%
dim pdf417
Set pdf417 = Server.CreateObject("PDF417ActiveX.PDF417Ctrl.1")

Call pdf417.SaveToImageFile(260, 150, "c:\pdf417.gif", 0, 3)

SET pdf417=nothing
%>
 
You should keep in mind that the user must have rights to write data to the corresponding folder. Usually, ASP code is executed under the IUSR_XXX account. And it usually has no such rights.