Export and Import Barcode Generation State via XML in C++

Overview

In Aspose.BarCode for C++, it is possible to perform the serialization of the barcode generation state and import it from XML using the specific functionality of class BarcodeGenerator. The serialization of a BarcodeGenerator instance can be executed in two ways: saving it to an XML-file using the ExportToXml(String) or to a stream through the ExportToXml(Stream) method.

Similarly, loading the barcode generation state from XML can be performed from a file using the ImportFromXml(String) method or a stream through the ImportFromXml(Stream) method.

Export Barcode Generation State to XML

As previously mentioned, there are two ways to save the current state of class BarcodeGenerator: to an XML file through the ExportToXml(String) function or to a stream using the ExportToXml(Stream) function. The code snippet below illustrates how to implement the serialization of a BarcodeGenerator instance to an XML file.

Import Barcode Generation State from XML

The current state of class BarcodeGenerator can be imported from an XML file using the ImportFromXml(String) function or from a stream through the ImportFromXml(Stream) function. The code sample provided below explains how to import the barcode generation state from an XML file.

Save and Load Barcode Generation State from Stream

The code snippet given below demonstrates how to save and load the barcode generation state from streams using two corresponding methods: ExportToXml(Stream) and ImportFromXml(Stream).