Link Search Menu Expand Document

Barcode Generator

Related Knowledgebase-Explore Samples

Generate high quality barcode images. Supports QR Code, Datamatrix, Code 39, Code 128, PDF417 and many other barcode types.

Available Methods

[POST] /barcode/generate

  • value required. Sets string value to encode inside barcode.
  • type optional. Sets barcode type. Default: QRCode.

Supported barcode types:

Code128
Code39
Postnet
UPCA
EAN8
ISBN
Codabar
I2of5
Code93
EAN13
JAN13
Bookland
UPCE
PDF417
PDF417Truncated
DataMatrix
QRCode
Aztec
Planet
EAN128
GS1_128
USPSSackLabel
USPSTrayLabel
DeutschePostIdentcode
DeutschePostLeitcode
Numly
PZN
OpticalProduct
SwissPostParcel
RoyalMail
DutchKix
SingaporePostalCode
EAN2
EAN5
EAN14
MacroPDF417
MicroPDF417
GS1_DataMatrix
Telepen
IntelligentMail
GS1_DataBar_Omnidirectional
GS1_DataBar_Truncated
GS1_DataBar_Stacked
GS1_DataBar_Stacked_Omnidirectional
GS1_DataBar_Limited
GS1_DataBar_Expanded
GS1_DataBar_Expanded_Stacked
MaxiCode
Plessey
MSI
ITF14
GTIN12
GTIN8
GTIN13
GTIN14
GS1_QRCode
PharmaCode
  • name optional. File name for generated output. Must be a String.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.
  • inline. optional. Set to true to generate datauri url instead of file.
  • decorationImage optional. works for QR Code only. Set this to the image that you want to be inserted logo inside QR Code barcode. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it.
  • async optional. Runs processing asynchronously. Returns JobId that you may use with /job/check to check state of the background job (possible states: working, failed, aborted and success). Must be one of: true, false.
  • profiles optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.

  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "async": false
}

Example responses

/barcode/generate
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/9a87556a8b9e4f4eae60843e697250d4/barcode.png",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "remainingCredits": 60631
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "async": false
}'

[POST] /barcode/generate (qr code)

  • value required. Sets string value to encode inside barcode.
  • type optional. Sets barcode type. Default: QRCode.

Supported barcode types:

Code128
Code39
Postnet
UPCA
EAN8
ISBN
Codabar
I2of5
Code93
EAN13
JAN13
Bookland
UPCE
PDF417
PDF417Truncated
DataMatrix
QRCode
Aztec
Planet
EAN128
GS1_128
USPSSackLabel
USPSTrayLabel
DeutschePostIdentcode
DeutschePostLeitcode
Numly
PZN
OpticalProduct
SwissPostParcel
RoyalMail
DutchKix
SingaporePostalCode
EAN2
EAN5
EAN14
MacroPDF417
MicroPDF417
GS1_DataMatrix
Telepen
IntelligentMail
GS1_DataBar_Omnidirectional
GS1_DataBar_Truncated
GS1_DataBar_Stacked
GS1_DataBar_Stacked_Omnidirectional
GS1_DataBar_Limited
GS1_DataBar_Expanded
GS1_DataBar_Expanded_Stacked
MaxiCode
Plessey
MSI
ITF14
GTIN12
GTIN8
GTIN13
GTIN14
GS1_QRCode
PharmaCode
  • name optional. File name for generated output. Must be a String.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.
  • inline. optional. Set to true to generate datauri url instead of file.
  • decorationImage optional. works for QR Code only. Set this to the image that you want to be inserted logo inside QR Code barcode. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it.
  • profiles optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.

  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false
}

Example responses

/barcode/generate (qr code)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/72bc579b37844d9f9e63ce06de5196d8/barcode.png",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "duration": 380,
    "remainingCredits": 98725598,
    "credits": 7
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false
}'

[POST] /barcode/generate (qr code with logo inside)

  • value required. Sets string value to encode inside barcode.
  • type optional. Sets barcode type. Default: QRCode.

Supported barcode types:

Code128
Code39
Postnet
UPCA
EAN8
ISBN
Codabar
I2of5
Code93
EAN13
JAN13
Bookland
UPCE
PDF417
PDF417Truncated
DataMatrix
QRCode
Aztec
Planet
EAN128
GS1_128
USPSSackLabel
USPSTrayLabel
DeutschePostIdentcode
DeutschePostLeitcode
Numly
PZN
OpticalProduct
SwissPostParcel
RoyalMail
DutchKix
SingaporePostalCode
EAN2
EAN5
EAN14
MacroPDF417
MicroPDF417
GS1_DataMatrix
Telepen
IntelligentMail
GS1_DataBar_Omnidirectional
GS1_DataBar_Truncated
GS1_DataBar_Stacked
GS1_DataBar_Stacked_Omnidirectional
GS1_DataBar_Limited
GS1_DataBar_Expanded
GS1_DataBar_Expanded_Stacked
MaxiCode
Plessey
MSI
ITF14
GTIN12
GTIN8
GTIN13
GTIN14
GS1_QRCode
PharmaCode
  • name optional. File name for generated output. Must be a String.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.
  • inline. optional. Set to true to generate datauri url instead of file.
  • decorationImage optional. works for QR Code only. Set this to the image that you want to be inserted logo inside QR Code barcode. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it.
  • profiles optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.

  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false,
    "decorationImage": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-generator/logo.png"
}

Example responses

/barcode/generate
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/9a87556a8b9e4f4eae60843e697250d4/barcode.png",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "remainingCredits": 60631
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": false,
    "async": false,
    "decorationImage": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-generator/logo.png"
}'

[POST] /barcode/generate (datauri as output)

  • value required. Sets string value to encode inside barcode.
  • type optional. Sets barcode type. Default: QRCode.

Supported barcode types:

Code128
Code39
Postnet
UPCA
EAN8
ISBN
Codabar
I2of5
Code93
EAN13
JAN13
Bookland
UPCE
PDF417
PDF417Truncated
DataMatrix
QRCode
Aztec
Planet
EAN128
GS1_128
USPSSackLabel
USPSTrayLabel
DeutschePostIdentcode
DeutschePostLeitcode
Numly
PZN
OpticalProduct
SwissPostParcel
RoyalMail
DutchKix
SingaporePostalCode
EAN2
EAN5
EAN14
MacroPDF417
MicroPDF417
GS1_DataMatrix
Telepen
IntelligentMail
GS1_DataBar_Omnidirectional
GS1_DataBar_Truncated
GS1_DataBar_Stacked
GS1_DataBar_Stacked_Omnidirectional
GS1_DataBar_Limited
GS1_DataBar_Expanded
GS1_DataBar_Expanded_Stacked
MaxiCode
Plessey
MSI
ITF14
GTIN12
GTIN8
GTIN13
GTIN14
GS1_QRCode
PharmaCode
  • name optional. File name for generated output. Must be a String.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.
  • inline. optional. Set to true to generate datauri url instead of file.
  • decorationImage optional. works for QR Code only. Set this to the image that you want to be inserted logo inside QR Code barcode. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it.
  • profiles optional. Must be a String. Use this parameter to set additional configuration for fine tuning and extra options. Explore PDF.co knowledgebase for profile examples.

  • Method: POST
  • URL: /v1/barcode/generate

Query parameters

No query parameters accepted.

Body payload

{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": true,
    "async": false
}

Example responses

/barcode/generate (datauri as output)
{
    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAOlSURBVHhe7ZBBimMxEMVy/0v34CELkSmBjH96NhaIwKtXlY9fP5fMfawN7mNtcB9rg/tYG9zH2kAf6/V6Pa5hHeaUTPNTjftYg8Z9rEEjPdYJdoc5JZaT0imUOzopywW7w5wSy0npFModnZTlgt1hTonlpHQK5Y5ObJm5SUpODeuU3CSWE53YMnOTlJwa1im5SSwnOrFl5iYpOTWsU3KTWE50YsvMTWI5sY7lxDrMTWI50YktMzeJ5cQ6lhPrMDeJ5UQntszcJJYT61hOrMPcJJYTndgyc5Ps5ob1S24Sy4lObJm5SXZzw/olN4nlRCe2zNwku7lh/ZKbxHKik7JcsDuWE3YosXyXckcnZblgdywn7FBi+S7ljk7KcsHuWE7YocTyXcodnXD5Kck38qc0dDIdOZV8I39KQyfTkVPJN/KnNHzyZaaPrP4v7mNtcB9rA/3n6SOXxHLCDiXTfFmY9j4l03xZ0NZ0cEksJ+xQMs2XhWnvUzLNlwVtTQeXxHLCDiXTfFmY9j4l03xZSK3p+JJYTtgxC9Pe0rAOc2qkr5sOLonlhB2zMO0tDeswp0b6uungklhO2DEL097SsA5zaqSvs0PMi8Zuxzyh3En/YIeYF43djnlCuZP+wQ4xLxq7HfOEcmf7H+yo5WS3Q42puySWk9R5/2bsqOVkt0ONqbsklpPUef9m7KjlZLdDjam7JJaT1Hn/fg1+hElKTo3SIaXfLh3AjzBJyalROqT026UD+BEmKTk1SoeUfrv0BdLHHXSYUyN13r+/Tvq4gw5zaqTO+/fXSR930GFOjdR5//4Dl5+SWF7gLiWWk9Ih2uKhpySWF7hLieWkdIi2eOgpieUF7lJiOSkdoq3dQ8bJHe5SY+oujam7NHRSlgsnd7hLjam7NKbu0tBJWS6c3OEuNabu0pi6S0MntszcJJYb7NPCbp+UXZ3YMnOTWG6wTwu7fVJ2dWLLzE1iucE+Lez2SdnViS0zN0nJTWPqVsk0Xxo6sWXmJim5aUzdKpnmS0MntszcJCU3jalbJdN8aejElpmbxPJdyh12KNnNiU5smblJLN+l3GGHkt2c6MSWmZvE8l3KHXYo2c2JTspywe4wp8TywsmuoZee+jO7w5wSywsnu4ZeeurP7A5zSiwvnOwaeol/9pTEcsIONabup8RyQ1s89JTEcsIONabup8RyQ1s89JTEcsIONabup8Ryo7Uuf7mPtcF9rA3uY21wH2uD+1iZn58/9whzEbhRquEAAAAASUVORK5CYII=",
    "error": false,
    "status": 200,
    "name": "barcode.png",
    "duration": 298,
    "remainingCredits": 98725605,
    "credits": 7
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/generate' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "name": "barcode.png",
    "value": "abcdef123456",
    "type": "QRCode",
    "inline": true,
    "async": false
}'

Knowledgebase

Samples