Blog
Api2Pdf adds support for barcode and QR code generation with ZXING on AWS Lambda
Many Api2Pdf customers generate PDFs for the purposes of generating packing slips, invoices, receipts, product labels, the list goes on and on. It only makes sense for us to make it even more convenient for you to generate barcodes and QR codes. Today, we are announcing the release of our ZXING (“Zebra Crossing”) API endpoint. ZXING is a wonderful library for generating codes of varying types. Generating a barcode is super simple. This ZXING runs on our serverless architecture (AWS Lambda) as our PDF rendering does, so you can be sure it will never go down under the load.
Just format your URL like so:
https://v2018.api2pdf.com/zebra?apikey={YourApiKey}&format={format}&value={text}
This will generate an image in PNG format. Optional parameters include showlabel (bool), height (int), width (int) to control whether the actual text appears beneath the barcode as well as the size of the barcode image.
Format is almost always CODE_39 or QR_CODE, but we have full documentation of what you can do with this endpoint here.
The cost for barcode generation follows the same megabytes in (0.0) and megabytes out. For barcodes, it’s quite negligible and could probably generate over a million barcodes for $1.
Suggested Use Case
While you can generate stand alone barcodes just via the URL, we believe most of you will want to include these barcodes inside a generated PDF. Begin by using our WKHTMLTOPDF or Headless Chrome endpoints with the html setting.
Then, in your HTML include an image tag:<img src="https://v2018.api2pdf.com/zebra?apikey={YourApiKey}&format=QR_CODE&value=test+bar+code"/>
We hope you find this new endpoint as useful as we do.