com.aspose.barcode.generation.internal

Class D2Properties

  • java.lang.Object
    • com.aspose.barcode.generation.internal.D2Properties


  • public class D2Properties
    extends java.lang.Object

    Contains specific configuration properties for for 2D barcodes.


      This sample shows how to create and save a BarCode image.
      
         BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
         generator.getD2().setAspectRatio(1.5f);
         generator.save("test.png");
            
    • Constructor Summary

      Constructors 
      Constructor and Description
      D2Properties() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      float getAspectRatio()
      Height/Width ratio of 2D BarCode module.
      java.nio.charset.Charset getCodeTextEncoding()
      Gets the encoding of codetext.
      int getColumns()
      2D BarCode's columns, if setting is illegal then columns will be calculated automatically.
      java.lang.String getDisplayText()
      Gets the text will displayed on the barcode image.
      int getRows()
      BarCode's rows, if setting is illegal then rows will be calculated automatically.
      void setAspectRatio(float value)
      Height/Width ratio of 2D BarCode module.
      void setCodeTextEncoding(java.nio.charset.Charset value)
      Sets the encoding of codetext.
      void setColumns(int value)
      2D BarCode's columns, if setting is illegal then columns will be calculated automatically.
      void setDisplayText(java.lang.String value)
      Sets the text will displayed on the barcode image.
      void setRows(int value)
      BarCode's rows, if setting is illegal then rows will be calculated automatically.
      java.lang.String toString()
      Returns a human-readable string representation of this D2Properties
      • Methods inherited from class java.lang.Object

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

      • D2Properties

        public D2Properties()
    • Method Detail

      • getAspectRatio

        public float getAspectRatio()

        Height/Width ratio of 2D BarCode module. See xDimension.


          This sample shows how to create and save a BarCode image.
            
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
                 generator.getD2().setAspectRatio(1.5f);
                 float aspectRatio =   generator.getD2().getAspectRatio();
                 generator.save("test.png");
                
      • setAspectRatio

        public void setAspectRatio(float value)

        Height/Width ratio of 2D BarCode module. See xDimension.


          This sample shows how to create and save a BarCode image.
          
              BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
              generator.getD2().setAspectRatio(1.5f);
              generator.save("test.png");
                
        Throws:
        java.lang.IllegalArgumentException - <p>The <b>AspectRatio</b> parameter value is less than or equal to 0.</p>
        java.lang.IllegalArgumentException - <p>The <b>AspectRatio</b> can't be specified when AutoSizeMode is set to NEAREST.</p>
      • getColumns

        public int getColumns()

        2D BarCode's columns, if setting is illegal then columns will be calculated automatically. applicable SymbologyType: Pdf417, CodablockF, DatabarExpandedStacked.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.PDF_417);
                 generator.getD2().setColumns(3);
                 generator.getD2().setRows(6);
                 generator.save("test.png");
                
      • setColumns

        public void setColumns(int value)

        2D BarCode's columns, if setting is illegal then columns will be calculated automatically. applicable SymbologyType: Pdf417, CodablockF, DatabarExpandedStacked.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.PDF_417);
                 generator.getD2().setColumns(3);
                 generator.getD2().setRows(6);
                 generator.save("test.png");
                
      • getRows

        public int getRows()

        BarCode's rows, if setting is illegal then rows will be calculated automatically. Applicable Symbology: Pdf417, DatabarExpandedStacked, CodablockF, DatabarExpandedStacked.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.PDF_417);
                 generator.getD2().setColumns(3);
                 generator.getD2().setRows(6);
                 generator.save("test.png");
                
      • setRows

        public void setRows(int value)

        BarCode's rows, if setting is illegal then rows will be calculated automatically. Applicable Symbology: Pdf417, DatabarExpandedStacked, CodablockF, DatabarExpandedStacked.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.PDF_417);
                 generator.getD2().setColumns(3);
                 generator.getD2().setRows(6);
                 generator.save("test.png");
                
      • getDisplayText

        public java.lang.String getDisplayText()

        Gets the text will displayed on the barcode image. Available only for 2D barcodes. Limited to 1000 chars.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
                 generator.setCodeText("ABC \\x00\\x01\\x02 DEF");
                 generator.getD2().setDisplayText("Print text");
                 generator.getD2().getDisplayText();
                 generator.save("test.png");
                
        Value: The text to display.
      • setDisplayText

        public void setDisplayText(java.lang.String value)

        Sets the text will displayed on the barcode image. Available only for 2D barcodes. Limited to 1000 chars.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
                 generator.setCodeText("ABC \\x00\\x01\\x02 DEF");
                 generator.getD2().setDisplayText("Print text");
                 generator.save("test.png");
                
        Value: The text to display.
      • getCodeTextEncoding

        public java.nio.charset.Charset getCodeTextEncoding()

        Gets the encoding of codetext.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
                 generator.setCodeText("Example");
                 generator.getD2().setCodeTextEncoding(Charset.forName("UTF-8"));
                 Charset charset = generator.getD2().getCodeTextEncoding();
                 generator.save("test.png");
                
        Value: The encoding for codetext.
      • setCodeTextEncoding

        public void setCodeTextEncoding(java.nio.charset.Charset value)

        Sets the encoding of codetext.


          This sample shows how to create and save a BarCode image.
          
                 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
                 generator.setCodeText("Example");
                 generator.getD2().setCodeTextEncoding(Charset.forName("UTF-8"));
                 generator.save("test.png");
                
        Value: The encoding for codetext.
      • toString

        public java.lang.String toString()
        Returns a human-readable string representation of this D2Properties
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string that represents this D2Properties