Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created September 9, 2025 12:09
Show Gist options
  • Select an option

  • Save aspose-com-gists/154a00b1a182012f05adb2289a0efe91 to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/154a00b1a182012f05adb2289a0efe91 to your computer and use it in GitHub Desktop.
Generate Royal Mail 4-State Customer Code in C#
using Aspose.BarCode;
using Aspose.BarCode.Generation;
// Set the path for the working directory and load the Aspose license.
string path = "data";
License lic = new License();
lic.SetLicense("License.lic");
// Define the type of barcode you want to generate (here: RM4SCC)
// Initialize a BarcodeGenerator instance with EncodeTypes and the code text.
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.RM4SCC, "IUY6BS00");
// Set the width of barcode elements (X-dimension) in pixels
gen.Parameters.Barcode.XDimension.Pixels = 3;
// Save the generated barcode image in PNG format to the specified path.
gen.Save($"{path}RM4SCC.png", BarCodeImageFormat.Png);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment