public static void Run() { // ExStart:1 // Instantiate Aspose Storage Cloud API SDK StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // Instantiate Aspose BarCode Cloud API SDK BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // set input file name String name = "sample-barcode.jpeg"; //The barcode type. //If this parameter is empty, autodetection of all supported types is used. String type = ""; // Set folder location at cloud storage String folder = ""; BarcodeReader body = new BarcodeReader(); // Set if FNC symbol stripping should be performed. body.StripFNC = true; // Set mode for checksum validation during recognition body.ChecksumValidation = "ON"; // Set special mode of barcode binarization body.BinarizationHints = BinarizationHints.ComplexBackground; try { //upload source file to aspose cloud storage BarcodeResponseList apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body); // invoke Aspose.BarCode Cloud SDK API to recognition of a barcode from file on server with parameters in body apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body); if (apiResponse != null) { foreach (Barcode barcode in apiResponse.Barcodes) { Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); } Console.WriteLine("Recognize Barcode with Checksum Option, Done!"); } } catch (Exception ex) { Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 // Instantiate Aspose BarCode Cloud API SDK BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // set input file name String name = "sample-barcode.jpeg"; //The barcode type. //If this parameter is empty, autodetection of all supported types is used. String type = ""; //Set mode for checksum validation during recognition String checksumValidation = ""; //Set if FNC symbol stripping should be performed bool stripFnc = false; //Set recognition of rotated barcode int rotationAngle = 0; //Set the image file url String url = null; byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + name); try { //invoke Aspose.BarCode Cloud SDK API to read barcode from local file BarcodeResponseList apiResponse = barcodeApi.PostBarcodeRecognizeFromUrlorContent(type, checksumValidation, stripFnc, rotationAngle, url, file); if (apiResponse != null) { foreach (Barcode barcode in apiResponse.Barcodes) { Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); } Console.WriteLine("Read Barcode from Local File, Done!"); } } catch (Exception ex) { Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 // Instantiate Aspose BarCode Cloud API SDK BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); //The barcode type. //If this parameter is empty, autodetection of all supported types is used. String type = ""; //Set mode for checksum validation during recognition String checksumValidation = ""; //Set if FNC symbol stripping should be performed bool stripFnc = false; //Set recognition of rotated barcode int rotationAngle = 0; //Set the image file url String url = "http://www.barcoding.com/images/Barcodes/code93.gif"; byte[] file = null; try { //invoke Aspose.BarCode Cloud SDK API to read barcode from external image URL BarcodeResponseList apiResponse = barcodeApi.PostBarcodeRecognizeFromUrlorContent(type, checksumValidation, stripFnc, rotationAngle, url, file); if (apiResponse != null) { foreach (Barcode barcode in apiResponse.Barcodes) { Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); } Console.WriteLine("Read Barcode from External Image URL, Done!"); } } catch (Exception ex) { Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 // Instantiate Aspose BarCode Cloud API SDK BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // Set Filename of image String name = "sample-barcode"; // Set Text to encode inside barcode String text = "Aspose.BarCode"; // Set Barcode Symbology String type = "datamatrix"; // Set Barcode Image Format String format = "PNG"; // Sets if checksum will be added to barcode image. String enableChecksum = null; //Set optional params (if any) float? resolutionX = null; float? resolutionY = null; float? dimensionX = null; float? dimensionY = null; try { //invoke Aspose.BarCode Cloud SDK API to create barcode and save image to a stream ResponseMessage apiResponse = barcodeApi.GetBarcodeGenerate(text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, enableChecksum); if (apiResponse != null) { //download generated barcode from api response System.IO.File.WriteAllBytes(Common.OUTFOLDER + name + "." + format, apiResponse.ResponseStream); Console.WriteLine("Generate a Barcode and Get as a Image Stream, Done!"); } } catch (Exception ex) { Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public void TestGetBarcodeGenerate() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); string text = "TestGetBarcodeGenerate"; string type = "1"; string format = "jpeg"; float? resolutionX = null; float? resolutionY = null; float? dimensionX = null; float? dimensionY = null; string enableChecksum = ""; ResponseMessage actual; actual = target.GetBarcodeGenerate(text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, enableChecksum); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new ResponseMessage(), actual.GetType()); }
public static void Run() { // ExStart:1 // Instantiate Aspose Storage Cloud API SDK StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // Instantiate Aspose BarCode Cloud API SDK BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // set input file name String name = "sample-barcode.jpeg"; //The barcode type. //If this parameter is empty, autodetection of all supported types is used. String type = ""; //Sets mode for checksum validation during recognition String checksumValidation = ""; //Sets if FNC symbol stripping should be performed. bool stripFnc = true; //Sets recognition of rotated barcode int? rotationAngle = null; //Sets exact number of barcodes to recognize int? barcodesCount = null; //Set recognition of barcode inside specified Rectangle region int? rectX = 10; int? rectY = 10; int? rectWidth = 200; int? rectHeight = 200; //Set 3rd party cloud storage server (if any) String storage = ""; // Set folder location at cloud storage String folder = ""; try { //upload source file to aspose cloud storage storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name)); // invoke Aspose.BarCode Cloud SDK API to read barcode with specific region of image BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder); if (apiResponse != null) { foreach (Barcode barcode in apiResponse.Barcodes) { Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); } Console.WriteLine("Read Barcode from Specific Region of Image, Done!"); } } catch (Exception ex) { Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 // Instantiate Aspose Storage Cloud API SDK StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // Instantiate Aspose BarCode Cloud API SDK BarcodeApi barcodeApi = new BarcodeApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); // Set the barcode file name created on server. String name = "sample-barcode"; // Set Text to encode inside barcode. String text = "AsposeBarCode"; // Set Barcode Symbology String type = "Code128"; // Set Generated Barcode Image Format String format = "png"; // Set Resolution along X and Y in dpi. float? resolutionX = null; float? resolutionY = null; //Set Width and Height of barcode unit float? dimensionX = null; float? dimensionY = null; //Set Location, Measurement of the code String codeLocation = "Below"; String grUnit = "mm"; // Sets if barcode's size will be updated automatically String autoSize = "true"; // Height of the bar. float? barHeight = null; //Set height, Width and quality of the image. float? imageHeight = null; float? imageWidth = null; String imageQuality = "default"; // Set Angle of barcode orientation float? rotAngle = null; // Set Margin of image border float? topMargin = null; float? bottomMargin = null; float? leftMargin = null; float? rightMargin = null; // Sets if checksum will be added to barcode image. String enableChecksum = ""; //Set 3rd party cloud storage server (if any) String storage = ""; String folder = ""; // Set local file (if any) byte[] file = null; try { // invoke Aspose.BarCode Cloud SDK API to generate barcode with appropriate code text location and put in cloud storage SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); if (apiResponse != null) { // download generated barcode from cloud storage Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name, null, null); //Save response stream to a file System.IO.File.WriteAllBytes(Common.OUTFOLDER + name + "." + format, storageRes.ResponseStream); Console.WriteLine("Generate Barcode with Appropriate Code Text Location, Done!"); } } catch (Exception ex) { Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Main(String[] args) { string APIKEY = "xxxxxx"; string APPSID = "xxxxxx"; string BASEPATH = "http://api.aspose.com/v1.1"; ///* //* Working with Barcode Generation //* Create Barcode and Get Image as Stream //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "Aspose.BarCode"; //String type = "datamatrix"; //String format = "PNG"; //float? resolutionX = null; //float? resolutionY = null; //float? dimensionX = null; //float? dimensionY = null; //String enableChecksum = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // ResponseMessage apiResponse = barcodeApi.GetBarcodeGenerate(text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, enableChecksum); // if (apiResponse != null) // { // //download appended document from storage server // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, apiResponse.ResponseStream); // Console.WriteLine("Create Barcode and Get Image as Stream, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Create Barcode on Aspose Cloud Storage //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = null; //float? resolutionY = null; //float? dimensionX = null; //float? dimensionY = null; //String codeLocation = "Below"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = null; //float? imageHeight = null; //float? imageWidth = null; //String imageQuality = "default"; //float? rotAngle = null; //float? topMargin = null; //float? bottomMargin = null; //float? leftMargin = null; //float? rightMargin = null; //String enableChecksum = ""; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Create Barcode on Aspose Cloud Storage, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Create Barcode and Save Image to Local Disk //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "Aspose.BarCode"; //String type = "QR"; //String format = "PNG"; //float? resolutionX = 96.0f; //float? resolutionY = 96.0f; //float? dimensionX = 0.7f; //float? dimensionY = 2.0f; //String enableChecksum = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // ResponseMessage apiResponse = barcodeApi.GetBarcodeGenerate(text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, enableChecksum); // if (apiResponse != null) // { // //download appended document from storage server // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, apiResponse.ResponseStream); // Console.WriteLine("Create Barcode and Save Image to Local Disk, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Set Barcode Image Resolution //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 200.0f; //float? resolutionY = 200.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 0.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Set Barcode Image Resolution, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Set X and Y Dimensions of a Barcode //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 1.0f; //float? resolutionY = 0.0f; //float? dimensionX = 1.0f; //float? dimensionY = 0.5f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 0.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Set X and Y Dimensions of a Barcode, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Specify Barcode Image Save Format //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 1.0f; //float? resolutionY = 0.0f; //float? dimensionX = 1.0f; //float? dimensionY = 0.5f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 0.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Specify Barcode Image Save Format, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Generate Barcode with Appropriate Code Text Location //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 0.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Generate Barcode with Appropriate Code Text Location, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Generate Barcode with Checksum Option //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 0.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Generate Barcode with Checksum Option, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Rotate Barcode Image with Suitable Angle //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 90.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Rotate Barcode Image with Suitable Angle, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Set Barcode Image Height, Width and Quality along with Auto Size Option //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 0.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 90.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Set Barcode Image Height, Width and Quality along with Auto Size Option, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Set Height of the Bars in the Barcode Image //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 50.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 90.0f; //float? topMargin = 0.0f; //float? bottomMargin = 0.0f; //float? leftMargin = 0.0f; //float? rightMargin = 0.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Set Height of the Bars in the Barcode Image, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Set Barcode Image Margin //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //String type = "Code128"; //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 50.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 90.0f; //float? topMargin = 2.0f; //float? bottomMargin = 2.0f; //float? leftMargin = 2.0f; //float? rightMargin = 2.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Set Barcode Image Margin, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Generation //* Specify Codetext and Symbology for barcode //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode"; //String text = "AsposeBarCode"; //CodeText //String type = "Code128"; //symbology //String format = "jpeg"; //float? resolutionX = 0.0f; //float? resolutionY = 0.0f; //float? dimensionX = 0.0f; //float? dimensionY = 0.0f; //String codeLocation = "Above"; //String grUnit = "mm"; //String autoSize = "true"; //float? barHeight = 50.0f; //float? imageHeight = 0.0f; //float? imageWidth = 0.0f; //String imageQuality = "default"; //float? rotAngle = 90.0f; //float? topMargin = 2.0f; //float? bottomMargin = 2.0f; //float? leftMargin = 2.0f; //float? rightMargin = 2.0f; //String enableChecksum = "Yes"; //String storage = ""; //String folder = ""; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // SaaSposeResponse apiResponse = barcodeApi.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); // if (apiResponse != null) // { // //download appended document from storage server // Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(name + "." + format, null, null); // System.IO.File.WriteAllBytes("\\temp\\new_" + name + "." + format, storageRes.ResponseStream); // Console.WriteLine("Specify Codetext and Symbology for barcode, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Read Barcode from External Image URL //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //String type = ""; //String checksumValidation = ""; //bool stripFnc = false; //int rotationAngle = 0; //String url = "http://www.barcoding.com/images/Barcodes/code93.gif"; //byte[] file = null; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.PostBarcodeRecognizeFromUrlorContent(type, checksumValidation, stripFnc, rotationAngle, url, file); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Create Barcode and Get Image as Stream, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Read Barcode from Local Image //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode.jpeg"; //String type = ""; //String folder = ""; //BarcodeReader body = new BarcodeReader(); //body.StripFNC = true; //body.ChecksumValidation = "OFF"; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Read Barcode from Local Image, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Read Barcode from Aspose Cloud Storage //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "barcodePng.png"; //String type = ""; //String checksumValidation = ""; //bool stripFnc = true; //int? rotationAngle = null; //int? barcodesCount = null; //int? rectX = null; //int? rectY = null; //int? rectWidth = null; //int? rectHeight = null; //String storage = ""; //String folder = ""; //try //{ // //upload source file to aspose cloud storage // storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Read Barcode from Aspose Cloud Storage, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Read Barcode from Specific Region of Image //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "barcodePng.png"; //String type = ""; //String checksumValidation = ""; //bool stripFnc = true; //int? rotationAngle = null; //int? barcodesCount = null; //int? rectX = 10; //int? rectY = 10; //int? rectWidth = 200; //int? rectHeight = 200; //String storage = ""; //String folder = ""; //try //{ // //upload source file to aspose cloud storage // storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Read Barcode from Specific Region of Image, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Recognize Barcode with Checksum Option from Storage //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode.jpeg"; //String type = ""; //String folder = ""; //BarcodeReader body = new BarcodeReader(); //body.StripFNC = true; //body.ChecksumValidation = "ON"; //body.BinarizationHints = BinarizationHints.ComplexBackground; //try //{ // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Recognize Barcode with Checksum Option from Storage, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Recognize Specified count of Barcodes //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode.jpeg"; //String type = ""; //String checksumValidation = "ON"; //bool stripFnc = true; //int? rotationAngle = null; //int? barcodesCount = null; //int? rectX = null; //int? rectY = null; //int? rectWidth = null; //int? rectHeight = null; //String storage = ""; //String folder = ""; //try //{ // //upload source file to aspose cloud storage // storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Read Barcode from Aspose Cloud Storage, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} ///* //* Working with Barcode Recognition //* Recognize Specified count of Barcodes //*/ //BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); //StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); //String name = "sample-barcode.jpeg"; //String type = ""; //String checksumValidation = "ON"; //bool stripFnc = true; //int? rotationAngle = null; //int? barcodesCount = null; //int? rectX = null; //int? rectY = null; //int? rectWidth = null; //int? rectHeight = null; //String storage = ""; //String folder = ""; //try //{ // //upload source file to aspose cloud storage // storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); // //invoke Aspose.PDF Cloud SDK API to append word document // BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder); // if (apiResponse != null) // { // foreach (Barcode barcode in apiResponse.Barcodes) // { // Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); // } // Console.WriteLine("Recognize Specified count of Barcodes, Done!"); // Console.ReadKey(); // } //} //catch (Exception ex) //{ // System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); //} /* * Working with Barcode Recognition * Read Barcodes by Applying Image Processing Algorithm */ BarcodeApi barcodeApi = new BarcodeApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); String name = "sample-barcode.jpeg"; String type = ""; String folder = ""; BarcodeReader body = new BarcodeReader(); body.StripFNC = true; body.ChecksumValidation = "OFF"; body.BinarizationHints = BinarizationHints.ComplexBackground; try { //upload source file to aspose cloud storage storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); //invoke Aspose.PDF Cloud SDK API to append word document BarcodeResponseList apiResponse = barcodeApi.PutBarcodeRecognizeFromBody(name, type, folder, body); if (apiResponse != null) { foreach (Barcode barcode in apiResponse.Barcodes) { Console.WriteLine("Codetext: " + barcode.BarcodeValue + "\nType: " + barcode.BarcodeType); } Console.WriteLine("Read Barcodes by Applying Image Processing Algorithm, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } /* * End... */ }
public void TestGetBarcodeRecognize() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "barcodePng.png"; string type = ""; string checksumValidation = ""; bool? stripFnc = null; int? rotationAngle = null; int? barcodesCount = null; int? rectX = null; int? rectY = null; int? rectWidth = null; int? rectHeight = null; string storage = ""; string folder = ""; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); BarcodeResponseList actual; actual = target.GetBarcodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new BarcodeResponseList(), actual.GetType()); }
public void TestPutGenerateMultiple() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); string name = "barcodePng.png"; string format = ""; string folder = ""; BarcodeBuilders body = new BarcodeBuilders(); BarcodeBuilder barcodeBuilder1 = new BarcodeBuilder(); barcodeBuilder1.TypeOfBarcode = "qr"; barcodeBuilder1.Text = "The Latest barcode"; BarcodeBuilder barcodeBuilder2 = new BarcodeBuilder(); barcodeBuilder2.TypeOfBarcode = "qr"; barcodeBuilder2.Text = "The Latest barcode"; body.BarcodeBuilderList = new System.Collections.Generic.List<BarcodeBuilder> { barcodeBuilder1, barcodeBuilder2 }; SaaSposeResponse actual; actual = target.PutGenerateMultiple(name, format, folder, body); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new SaaSposeResponse(), actual.GetType()); }
public void TestPutBarcodeRecognizeFromBody() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); StorageApi storageApi = new StorageApi(APIKEY, APPSID, BASEPATH); string name = "barcodePng.png"; string type = ""; string folder = ""; BarcodeReader body = new BarcodeReader(); body.StripFNC = true; body.ChecksumValidation = "OFF"; storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes("\\temp\\barcode\\resources\\" + name)); BarcodeResponseList actual; actual = target.PutBarcodeRecognizeFromBody(name, type, folder, body); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new BarcodeResponseList(), actual.GetType()); }
public void TestPutBarcodeGenerateFile() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); string name = "testbar.png"; string text = "Aspose.Barcode for Cloud"; string type = "qr"; string format = ""; float? resolutionX = null; float? resolutionY = null; float? dimensionX = null; float? dimensionY = null; string codeLocation = ""; string grUnit = ""; string autoSize = ""; float? barHeight = null; float? imageHeight = null; float? imageWidth = null; string imageQuality = ""; float? rotAngle = null; float? topMargin = null; float? bottomMargin = null; float? leftMargin = null; float? rightMargin = null; string enableChecksum = ""; string storage = ""; string folder = ""; byte[] file = null; SaaSposeResponse actual; actual = target.PutBarcodeGenerateFile(name, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder, file); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new SaaSposeResponse(), actual.GetType()); }
public void TestPostGenerateMultiple() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); string format = "png"; BarcodeBuilders body = new BarcodeBuilders(); BarcodeBuilder barcodeBuilder1 = new BarcodeBuilder(); barcodeBuilder1.TypeOfBarcode = "qr"; barcodeBuilder1.Text = "The Latest barcode"; BarcodeBuilder barcodeBuilder2 = new BarcodeBuilder(); barcodeBuilder2.TypeOfBarcode = "qr"; barcodeBuilder2.Text = "The Latest barcode"; body.BarcodeBuilderList = new System.Collections.Generic.List<BarcodeBuilder> { barcodeBuilder1, barcodeBuilder2 }; ResponseMessage actual; actual = target.PostGenerateMultiple(format, body); Assert.AreEqual(200, actual.Code); Assert.IsInstanceOfType(new ResponseMessage(), actual.GetType()); }
public void TestPostBarcodeRecognizeFromUrlorContent() { BarcodeApi target = new BarcodeApi(APIKEY, APPSID, BASEPATH); string type = "gif"; string checksumValidation = ""; bool? stripFnc = false; int? rotationAngle = null; string url = "http://www.barcoding.com/images/Barcodes/code93.gif"; byte[] file = null; BarcodeResponseList actual; actual = target.PostBarcodeRecognizeFromUrlorContent(type, checksumValidation, stripFnc, rotationAngle, url, file); Assert.AreEqual("200", actual.Code); Assert.IsInstanceOfType(new BarcodeResponseList(), actual.GetType()); }