@@ -0,0 +1,1692 @@
+package com.aspose.barcode.examples.TwoD_barcodes.basic_features;%0A%0Aimport java.io.IOException;%0A%0Aimport com.aspose.barcode.BarCodeImageFormat;%0Aimport com.aspose.barcode.EncodeTypes;%0Aimport com.aspose.barcode.examples.Utils;%0Aimport com.aspose.barcode.generation.BarcodeGenerator;%0A%0Apublic class ImportExportBarcodeToXML %7B%0A%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09String dataDir = Utils.getDataDir(ImportExportBarcodeToXML.class) + %22TwoD_barcodes/BasicFeatures%22;%0A%0A%09%09ExportBarcodeToXML(dataDir);%0A%09%09ImportBarcodeFromXML(dataDir);%0A%09%7D%0A%0A%09public static void ExportBarcodeToXML(String dataDir) %7B%0A%09%09// ExStart:ExportBarcodeToXML%0A%09%09// Instantiate barcode object and set CodeText & Barcode Symbology%0A%09%09BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.PDF_417,%0A%09%09%09%09%22this is some test code text. %5Cn Second line %5Cn third line.%22);%0A%0A%09%09// Set width and height%0A%09%09generator.getParameters().getBarcode().getXDimension().setMillimeters(0.6f);%0A%09%09generator.getParameters().getBarcode().getBarHeight().setMillimeters(1.2f);%0A%0A%09%09String xmlFile = dataDir + %22barcode.xml%22;%0A%09%09generator.exportToXml(xmlFile);%0A%09%09// ExEnd:ExportBarcodeToXML%0A%09%09System.out.println(%22Barcode exported to XML and saved at %22 + dataDir);%0A%09%7D%0A%0A%09public static void ImportBarcodeFromXML(String dataDir) throws IOException %7B%0A%09%09// ExStart:ImportBarcodeFromXML%0A%09%09String xmlFile = dataDir + %22barcode.xml%22;%0A%0A%09%09// Instantiate barcode object and set CodeText & Barcode Symbology%0A%09%09BarcodeGenerator generator = BarcodeGenerator.importFromXml(xmlFile);%0A%09%09generator.save(dataDir + %22barcode_xml_out.jpg%22, BarCodeImageFormat.JPEG);%0A%09%09// ExEnd:ImportBarcodeFromXML%0A%09%09System.out.println(%22Imported barcode saved at %22 + dataDir);%0A%09%7D%0A%7D%0A

Create ImportExportBarcodeToXML.java