| Aspose.BarCode allows developers to rotate the barcode image by calling the setRotationAngleF() method of the barcode class.
The effects of some rotation angles are demonstrated in the figure below: Figure: Demonstration of common rotation angles
|
Programming Sample
[Java]
//Instantiate barcode object
BarCodeBuilder bb = new BarCodeBuilder();
//Set the code text of the barcode
bb.setCodeText("12345678");
//Roate clockwise for 180 degree (upside down)
bb.setRotationAngleF(180);
//Set the symbology type to code39
bb.setSymbologyType(Symbology.Code39Extended);
try
{
//Save the image to file
bb.save("c:\\test.tif");
}
catch (Exception ex)
{
ex.printStackTrace();
}
The barcode (rotated to 180 degree) generated after executing the above code is shown in the figure below:
Figure: Barcode rotated to 180 degree after example code execution
[Java]
//Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the code text of the barcode bb.setCodeText("12345678"); //Roate clockwise for 180 degree (upside down) bb.setRotationAngleF(180); //Set the symbology type to code39 bb.setSymbologyType(Symbology.Code39Extended); try { //Save the image to file bb.save("c:\\test.tif"); } catch (Exception ex) { ex.printStackTrace(); }
The barcode (rotated to 180 degree) generated after executing the above code is shown in the figure below:
Figure: Barcode rotated to 180 degree after example code execution

