Scaling barcodes (with text)

Scaling barcodes (with text)

Forum member · Sep 10, 2015
Is it possible to scale the text for a barcode (for example Code128)? the .XDimension only scales the barcode which will render the text outside the barcode-width.

Re: Scaling barcodes (with text)

Support · Sep 10, 2015
Hello, You can control the width of the text of Code128 barcode by setting desired font size. You will need to use the FontSize property of Code128 class of DynamicPDF API. Below is the code sample. Document document = new Document(); Page page = new Page(); document.Pages.Add(page); Code128 barCode = new Code128("Code 128 Barcode.", 50, 50, 48, 0.75F); barCode.XDimension = 1.5F; barCode.Font = Font.CourierBold; barCode.FontSize = 12; page.Elements.Add(barCode); document.Draw(@"C:\Temp\MyDocument.pdf"); Thanks, ceTe Software Support Team.