Download the PHP package faerber/pdf-to-zpl without Composer

On this page you can find all versions of the php package faerber/pdf-to-zpl. 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 pdf-to-zpl

PDF to ZPL

Convert a PDF into the ZPL format. Allowing for custom images, alphabets like Hebrew, Arabic and Cyrillic (without messing with fonts on the printer) and multipage shipping labels!

Gettings Started:

You will need admin rights to setup Imagick PDF reading (essential for this library).

Linux Environment Setup:

The minimum version for this package is 8.1.

Ensure you have Imagick and GD installed using:

(Or whatever PHP Version you are using) Then make sure to enable them in php.ini (usually enabled by default).

Imagick Settings

You may need to enable PDF permission in your Imagick settings.

Find this line and ensure the rights are set to read | write:

Change to:

If this line doesn't exist at all, add it. You'll only run into this with tiny linux boxes like Github Actions.

Imagick has had PDF related security issues. Convert only trusted PDFs. Here's one example: CVE-2020-29599

Windows Environment Setup:

Install GhostScript with choco and Imagick and GD extensions.

Converting Images:

Previewing Labels

The labelary API is used to generate images from ZPL allowing the label to be previewed. This is a free API that requires no auth so it can be used with no setup. Be sure to respect their rate limits!

Settings

There are many settings you can use to configure the conversion. You can use Imagick instead of GD, rotate and resize labels etc.

See Settings for more details.

Unit Testing

Run composer test. Testing is done via PHP Unit.

If you make major changes you may need to regenerate the test data (tests pass if each file is at least 95% similar to the test data generated with PHP 8.3 on my linux box). For example modifying scaling code where the output is correct but the test data is outdated. Run composer generate-test-data and manually verify the images are rendered correctly.

Benchmarking

Run composer benchmark. Benchmarking is done via phpbench.

Here's some basic performance information:

This was run on my workstation. (AMD Ryzen 9 7950x 16-core, 32Gib)

See phpbench output for more details.

Formatting

Run composer format. Formatting is done via php-cs-fixer.

How does this work?

  1. Loads the PDF and render each page as image
  2. Scale the image to match the DPI and aspect ratio of the label
  3. Convert each page into a grayscaled bitmap
  4. Run line encode the bitmap and marshall it into a ZPL binary representation
  5. Wrap the encoded data into a ZPL payload

All versions of pdf-to-zpl with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.9
psr/log Version ^3.0
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 faerber/pdf-to-zpl contains the following files

Loading the files please wait ....