Skip to main content

PharmacodeOptions Class

Contains options specific to the Pharmacode symbology.

Declaration

public class PharmacodeOptions extends BarcodeOptions

Remarks

Refer to the following help topic for additional information: Pharmacode.

The following code snippet creates a two-track Pharmacode barcode and customizes its encoding parameters with the Fluent API:

import com.devexpress.drawing.*;
import com.devexpress.docs.barcode.*;
import com.devexpress.system.drawing.*;
import com.devexpress.docs.Padding;

import java.io.*;
import java.nio.file.*;

public class Main {
    public static void main(String[] args) throws Exception {

        PharmacodeOptions options = PharmacodeOptionsBuilder.create()
            .withPharmacodeType(PharmacodeType.TWO_TRACK)
            .withPadding(new Padding(10))
            .withShowText(true)
            .withWidth(300)
            .withHeight(300)
            .build();

        Path outputDir = Path.of("output");
        Files.createDirectories(outputDir);

        try (FileOutputStream fileStream = new FileOutputStream(
                outputDir.resolve("pharmacode.png").toFile());
                BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
                    barcodeGenerator.export(
                            "987654",
                            fileStream,
                            DXImageFormat.getPng());
        }
    }
}

Inherited Members

com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
BarcodeOptions
PharmacodeOptions

PharmacodeOptions()

Initializes a new instance of the PharmacodeOptions class.

Declaration

public PharmacodeOptions()

Methods

getPharmacodeType() Method

Gets the Pharmacode type.

Declaration

public PharmacodeType getPharmacodeType()

Returns

Type Description
PharmacodeType

An enumeration value that specifies the Pharmacode type.

setPharmacodeType(PharmacodeType value) Method

Sets the Pharmacode type.

Declaration

public void setPharmacodeType(PharmacodeType value)

Parameters

Name Type Description
value PharmacodeType

The Pharmacode type.