Create Barcode
Barcode → Create Barcode
The Create Barcode API generates a standalone barcode or QR code as an image. You send the text to encode, barcodeType (e.g. qrCode, code128, dataMatrix), hideText (whether to show the text alongside the barcode), and optionally IsAsync. The API returns a binary image (e.g. PNG) of the barcode. Use the tester below to try it; more details are in the sections that follow.
Try the Create Barcode API
Endpoint: POST /api/v2/CreateBarcode · Required: api-key, text, barcodeType, hideText, IsAsync
Use the form below to send your API key, barcode content, type, and options. The response is the barcode image (binary or polling URL when async). No code required—fill the fields and click Send request.
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Create Barcode?
This endpoint creates a barcode or QR code as a standalone image file. You provide the text to encode and the barcode type; the API returns a binary image (e.g. PNG) suitable for printing, embedding in documents, or use in apps. No PDF is required—ideal when you only need the barcode graphic.
Key features
- 150+ barcode types – QR Code, Code128, DataMatrix, Aztec, HanXin, PDF417, Code39, EAN13/EAN8, UPC-A/UPC-E and more.
- Simple input – text and barcodeType; optional hideText to show or hide the human-readable text.
- Binary image output – PNG by default; use IsAsync for larger or high-density codes to avoid timeouts.
Use when you need a barcode image for labels, tickets, or apps. To put the barcode onto a PDF, use Add Barcode to PDF instead.
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| text | string | Yes | Text to encode in the barcode. |
| barcodeType | string | Yes | e.g. qrCode, code128, dataMatrix, aztec, hanXin, pdf417, code39, ean13, ean8, upcA, upcE. |
| hideText | boolean | Yes | If true, hide the human-readable text; if false, show it alongside the barcode. |
| IsAsync | boolean | Yes | Enable asynchronous processing. |
When to use Create Barcode
- Labels and packaging – Generate barcode images for printing on labels or packaging.
- Mobile and web apps – Create QR codes or barcodes for in-app scanning or display.
- Tickets and passes – Produce standalone codes for events or access control.
- Retail and inventory – Generate EAN/UPC or Code128 for products.
- Workflows – Use the image in Add Barcode to PDF or other tools that accept image input.
For request/response schemas and code samples, see Create Barcode in the PDF4me API docs.
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- The text content you want to encode in the barcode
- The barcode type selection
Response Format
The API returns a binary image file (PNG format by default):
- Status 200: Barcode creation completed immediately - binary image content in response body
- Status 202: Request accepted and processing asynchronously - use the Location header URL to poll for results
For asynchronous requests, poll the Location URL until status 200 is returned with the barcode image.