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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - GetBarcodeWidth Return Value
  FAQ FAQ  Forum Search   Register Register  Login Login

GetBarcodeWidth Return Value

 Post Reply Post Reply
Author
Message
btmi View Drop Down
Beginner
Beginner


Joined: 08 Feb 06
Location: Australia
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote btmi Quote  Post ReplyReply Direct Link To This Post Topic: GetBarcodeWidth Return Value
    Posted: 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
Back to Top
Gio View Drop Down
Beginner
Beginner
Avatar

Joined: 23 Aug 13
Location: Italy
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gio Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
btmi View Drop Down
Beginner
Beginner


Joined: 08 Feb 06
Location: Australia
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote btmi Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Gio View Drop Down
Beginner
Beginner
Avatar

Joined: 23 Aug 13
Location: Italy
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gio Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store