Download the PHP package rafsalvioni/zeus-barcode without Composer

On this page you can find all versions of the php package rafsalvioni/zeus-barcode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zeus-barcode

zeus-barcode

Introduction

zeus-barcode is a API to create, draw and manage barcode data. Its has many barcode implementations and they could be extended to create other barcodes.

Before use API, you should have in mind the context of API. The API tree are be structured on form below:

Basic API tree

The most part of these interfaces have been traits to implement some of its methods and abstract classes that implements these interfaces and use these traits.

Encoders

Barcodes can be encoded on different ways. Most barcodes are encoded using bars and spaces. Others uses the height of bars (full and half bar, for example). Now a days, we have implemented two encoders, but, you can implement others implementing EncoderInterface.

Renderers

Once a barcode is created, we can draw this barcode in different formats. A renderer is who do this. A renderer should be implement the RendererInterface. By default, this package has only the SVG renderer. There are a PDF and Image renderer too in separated packages.

Default usage

To create a barcode, you have to instantiate the barcode format wanted and gave the data to be encoded. For example, we create a Codabar barcode:

The code above will create a Codabar barcode with data "A123456B". This barcode will be drawed using SvgRenderer and the render() method show the result to browser, using especific headers.

All barcodes will be check if the data given can be encoded for them. A barcode exception will be throwed on error.

Calculating barcode checksums

Some barcodes needs checksum digits. On these cases, we have two situations:

For example, we will use the Ean13 format to create a barcode with and without checksum digit:

Setting narrow and wide bar/space width

To barcodes thas implements TwoWidthInterface, we can set which width of wide and narrow bar/space. Let's see:

Both widths are in pixels.

Formatting barcode's apresentation

We can parametrize how our barcode will be showed. There are many options for this. Let's see:

Example:

You can use too the scale() method on barcode. This method will resize all dimension options proportionallity.

Managing renderers

We see above how to use renderers on basic way. However, renderers can be setted to do some boring tasks when we use barcodes.

Styling renderer apresentation

As barcodes, renderers has some parameters to change how a barcode draw will be done. Are they:

Using last example, we can do this:

Using renderer's "merge" mode

By default, renderers draw one barcode at a time. If you draw a barcode and right after you draw another barcode, the resource of first draw will be lost. However, if you set "merge" option to "true", renderer will merge all barcodes draw with him, returning the resource of this merge. On wide/narrow example we can see this when we use the stream() method.

Example:

The RendererInterface::stream() method do the same of previous example. Its draw a lot of barcodes side by side.

Using a external resource to render

Sometimes, we need to draw a barcode on a external resource. Using the setResource() method, we can define a external resource and barcode will put it, always considering "offsetLeft" and "offsetTop" options. For this, the merge mode will be activated.

Example:


All versions of zeus-barcode with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5 <6
rafsalvioni/zeus-base Version 1.1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rafsalvioni/zeus-barcode contains the following files

Loading the files please wait ....