New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions Bookmark and Share
Kev

ASP.NET Barcode Web Server Control questions

Hi,

My company purchased the ASP.NET Barcode Web Server Control a few years ago. We use this dll in order to simulate barcodes printed by a certain printer. I've done some digging and testing and got everything working smoothly. However, the need for precision is very high and we want to get the images to look as similar as possible. I've got normal barcodes to work perfectly, but I have a few problems I need help with. I also need to mention that the dll is used to create an in-memory bitmap, which is in its turn drawn on top of another bitmap. This means that no direct css can be applied (as far as I know).

1 - One of the things I can't seem to find is how to change the font of an LinearServerControl.LinearBarcode object. I need to change both the font name, as well as the height. (The current values are Times New Roman 10pts). How can I achieve this?

Edit: Found the answer to this question myself ;
bc.Font.Name = "Swis721 BT";
bc.Font.Size = 8;

->The problem was that I was trying to set the font itself, which didn't work (bc.Font = myFont)

2 - I need to position the barcode image at exact coordinates, and when creating a barcode image, and disabling all the margins I can find, there's still 1 empty pixel row above and 1 row under the barcode image. Is there any way to remove this?

3 - When the showtext option is activated and the text is wider than the barcode image itself, the text gets clipped, and only part of the text is visible. In other words, the result image is only as wide as the barcode itself is, and when the text is wider than the barcode, only the part that fits under the barcode itself is shown. How can I fix this?

Just to be clear, I'm creating the image from C#.Net, and the image is then reused inside of another image, which is then shown in a website, the barcode object itself is not used directly inside the website.

Thank you on beforehand.


05-12-14     2081 day(s) ago    

  Report Abuse

 

Ben

Best Answer

I am sorry. I believe the alignment issue might be cause by the extremely small XDimension. All barcode symbologies have a minimum XDimensionMILS of about 11 (or .03 CM).

As for the text and the barcode, there should be a property named TextMargin

TextMarginCM
Default is 0.10
Sets the distance between the symbol and the text in centimeters.

Posted 2080 day(s) ago

()
()
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (4)

Kev
OK, good to know it will be fixed soon.

Regarding to the 11 Mils you mentioned, which barcode should have 11 Mils? As I mentioned before, I have to simulate a printer, and that specific one has certain barcodes that are only 2.5 MILS.

You didn't answer the question about the alignment of the barcode text, nor if it was possible to set the distance between the text and barcode itself somehow.

These are the only things I still need to know =)

Posted 2080 day(s) ago

()
()
   Report Abuse

Ben
Yes, there is a bug when the Image Resolution is 300 and up and the image is saved. This will clip the barcode. The current work around is to increase the Left-Margin or set the resolution to 96 dpi. This is an issue that is scheduled to be corrected in an upcoming release.

Another part of the issue is caused by an incorrect value. XDimensionMILS should equal 11 MILS (the default).

Posted 2080 day(s) ago

()
()
   Report Abuse

Kev
Hi,

My company is planning to upgrade to the next version (we're awaiting the final paperwork from our own company in order to be able to make the purchase). However, while the paperwork is being taken care of, I want to finish my application, and when we finally get the required dlls, just quickly replace them =)

As to which version we currently have ;
"idautomation.linearservercontrol" (ASP.NET Barcode Generation Server Control)
Runtime version: v1.1.4322
Version: 2009.0.0.0

I tried using the demo dll, and I found 1 bug;

C#

private void bc1()
{
var bc = new IDAutomation.LinearServerControl.LinearBarcode()
{
SymbologyID = LinearBarcode.Symbologies.Ean13,
DataToEncode = "238668063159",
ImageResolution = 300,
ShowText = true,
BarHeightCM = "1.524",
TopMarginCM = "0",
LeftMarginCM = "0",
CheckCharacter = true,
NarrowToWideRatio = "3",
XDimensionMILS = "2.5"
};

var bmp = bc.GetBitmapImageForBinaryStream();
bmp.Save(@"C:Users...Desktopean13.png", ImageFormat.Png);
}

-> the resulting barcode has some issues; not all characters are under the barcode and some characters are even under the demo text and outside the image itself.
*Note, for my final application the XDimensionMILS will be in the [14,16] range, which doesn't seem to have the same issue, but I still wanted to make you aware of this issue.

-----

The following code was the code that produced the clipping problem in the dll we currently posess:

private void bc2()
{
var bc = new IDAutomation.LinearServerControl.LinearBarcode()
{
SymbologyID = LinearBarcode.Symbologies.Interleaved25,
DataToEncode = "00030315",
ImageResolution = 300,
ShowText = true,
BarHeightCM = "1.524",
TopMarginCM = "0",
LeftMarginCM = "0",
CheckCharacter = false,
NarrowToWideRatio = "3",
XDimensionMILS = "2.5"
};

var bmp = bc.GetBitmapImageForBinaryStream();
bmp.Save(@"C:Users...Desktopint2of5.png", ImageFormat.Png);
}

This issue doesn't occur in the demo dll, however, the text under the barcode is centrally aligned, and the printer I'm trying to simulate has the text aligned to the left, is there any way to achieve this?

--

I have one final question; what property sets the distance between the barcode itself and the text from the barcode? (if any such property exists).



Thank you for your fast reply!


Posted 2081 day(s) ago

()
()
   Report Abuse

Ben
We attempted to look up the version of the component you purchased a few years ago but were not able to find any order for the ASP Component under the email domain. If you purchased quite some time ago, we have make several updates since your purchase/

As a test, I have streamed an image using the latest version of the Server Control (the example uses the demo version).

It is not possible to remove the extra pixel padding from Top/Bottom margin (even when the margin is set to 0). I cannot recall why the padding was adding but I would have to review notes.

The text issue is resolved in updates.

image

To test, download the demo version or upgrade the Priority Support & Upgrade Subscription.

Posted 2081 day(s) ago

()
()
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2019 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook