←Select platform

GetAllDefaultOptions Method

Summary
Gets a list of all the current barcode write options.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public BarcodeWriteOptions[] GetAllDefaultOptions() 
@property (nonatomic, strong, readonly) NSArray<__kindof LTBarcodeWriteOptions *> *allDefaultOptions; 
public BarcodeWriteOptions[] getAllDefaultOptions() 
public: 
array<BarcodeWriteOptions^>^ GetAllDefaultOptions();  
def GetAllDefaultOptions(self): 

Return Value

An array of BarcodeWriteOptions derived types that contain all the default write options currently set in this BarcodeWriter.

Remarks

The BarcodeWriter object contains an array of all the default write options used by the WriteBarcode method when no explicit options are passed by the user.

Refer to the BarcodeWriteOptions class for a list of the symbologies and the type of the derived BarcodeWriteOptions used by LEADTOOLS.

To get the options for a specific symbology, refer to GetDefaultOptions

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
 
public void BarcodeWriter_GetAllDefaultOptionsExample() 
{ 
   BarcodeEngine engine = new BarcodeEngine(); 
   BarcodeWriter writer = engine.Writer; 
 
   // Show information on all the default write option classes 
   BarcodeWriteOptions[] writeOptionsArray = writer.GetAllDefaultOptions(); 
   Console.WriteLine("Write options:"); 
   foreach (BarcodeWriteOptions writeOptions in writeOptionsArray) 
   { 
      Console.WriteLine("  {0} ({1}) supports options for the following symbologies:", writeOptions.GetType().Name, writeOptions.FriendlyName); 
      Console.WriteLine("     "); 
      BarcodeSymbology[] symbologies = writeOptions.GetSupportedSymbologies(); 
      for (int i = 0; i < symbologies.Length; i++) 
      { 
         Console.Write(symbologies[i]); 
         if (i != (symbologies.Length - 1)) 
         { 
            Console.Write(", "); 
         } 
         else 
         { 
            Console.WriteLine(); 
         } 
      } 
   } 
} 
 
import static org.junit.Assert.assertTrue; 
 
import java.io.File; 
import java.io.IOException; 
import java.nio.file.Path; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
 
 
public void barcodeWriterGetAllDefaultOptionsExample() { 
   BarcodeEngine engine = new BarcodeEngine(); 
   BarcodeWriter writer = engine.getWriter(); 
 
   // Show information on all the default write option classes 
   BarcodeWriteOptions[] writeOptionsArray = writer.getAllDefaultOptions(); 
   System.out.println("Write options:"); 
   for (BarcodeWriteOptions writeOptions : writeOptionsArray) { 
      System.out.printf("  %1s (%2s) supports options for the following symbologies:%n", 
            writeOptions.getClass().getName(), writeOptions.getFriendlyName()); 
      System.out.println("     "); 
      BarcodeSymbology[] symbologies = writeOptions.getSupportedSymbologies(); 
 
      for (int i = 0; i < symbologies.length; i++) { 
         System.out.println(symbologies[i]); 
         if (i != (symbologies.length - 1)) { 
            System.out.print(", "); 
         } else { 
            System.out.println(); 
         } 
      } 
 
      assertTrue("writeOptionsArray has the incorrect length", 
            writeOptionsArray.length == writer.getAllDefaultOptions().length); 
      System.out.println("writeOptionsArray contains all of the default BarcodeWriteOptions"); 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Barcode Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.