well i have a code bar..... and i have a page width the size of 150 pixels....... and the barcode can change the size.
how can i center the barcode???
i tryed to create a rectangle and insert inside the rectangle. and the proprietes of the rectangle be centered.....
how can i make that?
center on page...
Re: center on page...
Support · Nov 21, 2007Hello,
You can change the X, Y coordinates for the barcode to place it in the center of the page. You will have to calculate the X, Y using the page width, Height and the barcode width, height. Following is a sample code for this.
Document doc = new Document();
Page page = new Page();
Codabar codabar = new Codabar("123123", 0, 0, 50);
codabar.X = page.Dimensions.Body.Width / 2 - codabar.GetSymbolWidth() / 2;
codabar.Y = page.Dimensions.Body.Height / 2 - codabar.Height / 2;
page.Elements.Add(codabar);
doc.Pages.Add(page);
doc.DrawToWeb();
Thanks,
ceTe Software Support Team.
Re: center on page...
Forum member · Nov 21, 2007it worked ;) Ty very much