Hi Gilson ,
Thank you for using Syncfusion Products .
We are created the workaround to draw the barcode at center for variable barcode text length in PDF .Please refer the following code snippet to calculate the width
//get the barocde image
System.Drawing.Image img= barcode128A.ToImage();
float width = 0;
//calculate the width respective to the barcode image width
if(img.Width >page.GetClientSize().Width/2)
{
width =page.GetClientSize().Width/4;
}
else
{
width = (page.GetClientSize().Width/2)-img.Width/2;
}
We have attached the sample for your reference in below link :
http://www.syncfusion.com/downloads/support/directtrac/general/BarcodeSample-1378717508.zip
Please try this and let us know if you have further assistance .
We have logged the feature request for “ Align the barcode at center of the Pdf “ . We will let you know once we have implemented .
Thanks,
Abirami.
Hi Gilson,
We have created the work around sample for your requirement centering the barcode in an area.
We have attached the sample for your reference in below link :
http://www.syncfusion.com/downloads/support/directtrac/general/BarcodeSample1420795576.zip
Please try this and let us know if you have any further assistance .
Thanks,
Abirami