Print Page | Close Window

Bar code with text surrounded by code.

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2902
Printed Date: 22 Nov 24 at 6:51PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Bar code with text surrounded by code.
Posted By: mLipok
Subject: Bar code with text surrounded by code.
Date Posted: 17 May 14 at 10:12AM
Below is example how to draw Bar code with text surrounded by code. (script in AutoIt)
; ----------------------------------------------------------------------------------------------------------------
$oQP.SetOrigin($__QPDF_SORIGIN_TopLeft);
$oQP.SetMeasurementUnits($__QPDF_MUNITS_Milimeters)

; Get the width of the barcode With a bar width of 0,1 mm
Local $iBarcodeWidth = $oQP.GetBarcodeWidth(0.1, $sText, 1);

; Draw the barcode
$oQP.DrawBarcode($iBarcodeLeft, $iBarcodeTop, $iBarcodeWidth, $iBarcodeHeight, $sText, 1, 0);

$oQP.SetTextSize(11);
Local $iTextWidth = $oQP.GetTextWidth($sText)
Local $iTextHeight = $oQP.GetTextHeight()
$oQP.SetFillColor(1, 1, 1);
; Draw White Box
$oQP.DrawBox($iBarcodeLeft + ($iBarcodeWidth - $iTextWidth) / 2, $iBarcodeTop + $iBarcodeHeight - $iTextHeight, $iTextWidth, $iTextHeight, 1)

; Center the text
$oQP.SetTextAlign($__QPDF_TEXTALIGN_Center);

; Draw the text
$oQP.SetTextSize(10);
$oQP.DrawText($iBarcodeLeft + $iBarcodeWidth / 2, $iBarcodeTop + $iBarcodeHeight, $sText);
; ----------------------------------------------------------------------------------------------------------------



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk