-
-
Save aspose-com-gists/6fc020ff4becc4c21b8ee167210e8eb7 to your computer and use it in GitHub Desktop.
// create barcode generator | |
let generator = new BarcodeGenerator(EncodeTypes.AZTEC, "Aspose.BarCode"); | |
// set barcode's back color | |
generator.getParameters().setBackColor("#A9A9A9"); | |
// set barcode's bar color | |
generator.getParameters().getBarcode().setBarColor("#FFA500"); | |
// set border color | |
generator.getParameters().getBorder().setColor("#000000"); | |
// set text color | |
generator.getParameters().getBarcode().getCodeTextParameters().setColor("#FFA500"); | |
// set image resolution | |
generator.getParameters().setResolution(300); | |
// save barcode | |
generator.save("barcode.png", "PNG"); |
// set barcode's type | |
let encode_type = EncodeTypes.CODE_128; | |
// create barcode generator | |
let generator = new BarcodeGenerator(encode_type, null); | |
// set text | |
generator.setCodeText("Aspose.BarCode"); | |
// generate barcode | |
generator.save("barcode.png", "PNG"); |
// set barcode's type | |
let encode_type = EncodeTypes.QR; | |
// create barcode generator | |
let generator = new BarcodeGenerator(encode_type, null); | |
// set text | |
generator.setCodeText("Aspose.BarCode"); | |
// generate barcode | |
generator.save("barcode.png", "PNG"); |
@vladkras,
We have tried this scenario with the latest version of NodeJS but could not observe this issue. Could you please test the scenario with the latest version and share the feedback? We are also trying to establish the environment for Node 12 and will share our feedback after testing it.
@ahsaniqbalsidiqui, it's pretty easy to reproduce:
$ docker run --rm -it node:12 bash
# npm install aspose.barcode
I have installed node:12 as suggested by you and then followed the rest of the steps mentioned here:
https://docs.aspose.com/barcode/java/aspose-barcode-for-node-js-via-java-installation/#linux
No issue is observed and aspose.barcode is installed successfully using command npm install aspose.barcode
For your reference, to install Oracle JDK I followed the steps mentioned below.
https://hirosht.medium.com/install-oracle-jdk-1-8-and-set-environment-variables-in-ubuntu-82443a7b789
For installing Python 3, I used the following command:
sudo apt install python 3.8
npm install aspose.barcode
is not working on Node 12installations fails with error
(node:40) UnhandledPromiseRejectionWarning: TypeError [ERR_STREAM_NULL_VALUES]: May not write null values to stream