Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
GetBarcodeWidth Return Value |
Post Reply
|
| Author | |
btmi
Beginner
Joined: 08 Feb 06 Location: Australia Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: GetBarcodeWidth Return ValuePosted: 23 Sep 13 at 11:47PM |
|
It appears that the return value of GetBarcodeWidth does NOT respect the current SetMeasurementUnits setting, although the Nominal Width value appears to work.
Is this correct?
Edited by btmi - 23 Sep 13 at 11:48PM |
|
![]() |
|
Gio
Beginner
Joined: 23 Aug 13 Location: Italy Status: Offline Points: 8 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 Oct 13 at 9:10AM |
|
I have the same problem and cannot understand the return valued that is much bigger than the expected one...
I have many doubts also concerning the "nominal width": can somebody explain me its meaning/usage? Thank you, Giorgio
|
|
![]() |
|
btmi
Beginner
Joined: 08 Feb 06 Location: Australia Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 Oct 13 at 12:11AM |
|
From my experience the return value is in points (1/72 of an inch) and so you may need to apply some calculations to convert it into your preferred unit of measurement.
For the NominalWidth I use 1mm and that seems to work with with all of the devices I use to provide a width that will work with the DrawBarcode routine.
|
|
![]() |
|
Gio
Beginner
Joined: 23 Aug 13 Location: Italy Status: Offline Points: 8 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 Oct 13 at 9:17AM |
|
Hi btmi and thank you.
It doesn't seem to be measured in points because, if applied as width in the DrawBarcode, the returned value should "oversize" the barcode even if "points" are the current unit of measure... But independently by the correct value: which is the meaning of NominalWidth parameter? Giorgio
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 Oct 13 at 1:29PM |
|
Hello,
When you call DrawBarcode you specify a left, top, width and height parameter. When the barcode is drawn it is scaled to squeeze or stretch all of the bars into the required width. After it is drawn it is no longer a barcode but just a sequence of lines. You cannot obtain the width. For variable length barcode is it handy to know the number or thin bars the barcode is in width so that you can calculate the width value. You may want to try the following code to see visually what I mean. If you use GetBarcodeWidth to scale the Width parameter for the DrawBarcode funvtion then the thinnest bar in each of the top 4 barcode is the same width. The last 4 barcodes are scaled. double y = 50; QP.SetOrigin(1); QP.DrawBarcode(20, y, QP.GetBarcodeWidth(1, "1", 1), 30, "1", 1, 0); y += 50; QP.DrawBarcode(20, y, QP.GetBarcodeWidth(1, "12", 1), 30, "12", 1, 0); y += 50; QP.DrawBarcode(20, y, QP.GetBarcodeWidth(1, "123", 1), 30, "123", 1, 0); y += 50; QP.DrawBarcode(20, y, QP.GetBarcodeWidth(1, "1234", 1), 30, "1234", 1, 0); y += 50; QP.DrawBarcode(20, y, 50, 30, "1", 1, 0); y += 50; QP.DrawBarcode(20, y, 50, 30, "12", 1, 0); y += 50; QP.DrawBarcode(20, y, 50, 30, "123", 1, 0); y += 50; QP.DrawBarcode(20, y, 50, 30, "1234", 1, 0); y += 50; QP.SaveToFile("out.pdf"); Andrew. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store