com.aspose.barcode.generation

Class CodeTextStyle

  • java.lang.Object
    • com.aspose.barcode.generation.CodeTextStyle


  • public final class CodeTextStyle
    extends java.lang.Object

    Contains specific configuration properties for codetext of barcode.


      This sample shows how to create and save a BarCode image.
      
             BarCodeGenerator generator = new BarCodeGenerator(EncodeTypes.CODE_128);
             generator.getCodeTextStyle().setLocation(CodeLocation.Above);
             generator.getCodeTextStyle().setColor(Color.GREEN);
             generator.getCodeTextStyle().setAlignment(StringAlignment.Far);
             generator.getCodeTextStyle().getFont().setStyle(FontStyle.Italic);
             generator.getCodeTextStyle().getFont().getSize().setPoint(18);
             generator.getCodeTextStyle().getSpace().setMillimeters(5);
             generator.save("test.png");
            

    • Constructor Summary

      Constructors 
      Constructor and Description
      CodeTextStyle(CodeLocation codeLocation, com.aspose.barcode.StringAlignment alignment, Unit space, java.awt.Color color, FontUnit font) 
      CodeTextStyle(int codeLocation, int alignment, Unit space, java.awt.Color color, FontUnit font)
      Deprecated. 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      com.aspose.barcode.StringAlignment getAlignment()
      Gets or sets the alignment of the code text.
      java.awt.Color getColor()
      Specify the displaying CodeText's Color.
      FontUnit getFont()
      Specify the displaying CodeText's font.
      CodeLocation getLocation()
      Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText.
      Unit getSpace()
      Space between the CodeText and the BarCode in Unit value.
      void setAlignment(int value)
      Deprecated. 
      void setAlignment(com.aspose.barcode.StringAlignment value)
      Gets or sets the alignment of the code text.
      void setColor(java.awt.Color value)
      Specify the displaying CodeText's Color.
      void setLocation(CodeLocation value)
      Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText.
      void setLocation(int value)
      Deprecated. 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CodeTextStyle

        public CodeTextStyle(CodeLocation codeLocation,
                     com.aspose.barcode.StringAlignment alignment,
                     Unit space,
                     java.awt.Color color,
                     FontUnit font)
      • CodeTextStyle

        @Deprecated
        public CodeTextStyle(int codeLocation,
                                int alignment,
                                Unit space,
                                java.awt.Color color,
                                FontUnit font)
        Deprecated. 
    • Method Detail

      • getLocation

        public CodeLocation getLocation()

        Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, ISBN, EAN8 or EAN13.

      • setLocation

        public void setLocation(CodeLocation value)

        Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, ISBN, EAN8 or EAN13.

      • setLocation

        @Deprecated
        public void setLocation(int value)
        Deprecated. 

        Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, ISBN, EAN8 or EAN13.

      • getAlignment

        public com.aspose.barcode.StringAlignment getAlignment()

        Gets or sets the alignment of the code text.


        StringAlignment.Near means CodeText will be aligned to the left. StringAlignment.Far means CodeText will be aligned to the right. StringAlignment.Center means CodeText will be aligned to the center.

      • setAlignment

        public void setAlignment(com.aspose.barcode.StringAlignment value)

        Gets or sets the alignment of the code text.


        StringAlignment.Near means CodeText will be aligned to the left. StringAlignment.Far means CodeText will be aligned to the right. StringAlignment.Center means CodeText will be aligned to the center.

      • setAlignment

        @Deprecated
        public void setAlignment(int value)
        Deprecated. 

        Gets or sets the alignment of the code text.


        StringAlignment.Near means CodeText will be aligned to the left. StringAlignment.Far means CodeText will be aligned to the right. StringAlignment.Center means CodeText will be aligned to the center.

      • getColor

        public java.awt.Color getColor()

        Specify the displaying CodeText's Color.

      • setColor

        public void setColor(java.awt.Color value)

        Specify the displaying CodeText's Color.

      • getSpace

        public Unit getSpace()

        Space between the CodeText and the BarCode in Unit value.

      • getFont

        public FontUnit getFont()

        Specify the displaying CodeText's font.