Skip to content

Barcode value font and scaling is not working as expected #14

@vikaskumar113

Description

@vikaskumar113

Hi there,

I’m working with this library to generate several types of barcodes. Currently, I’m working on EAN-8 and I’d like the barcode to be generated exactly like the example below:

Image

In this example, there is a top margin and the left and right margins are equal. I’ve tried adjusting different values for scale, width, and height, but haven’t had any luck.

Here’s the configuration I’m currently using:

     if barcode is BCKEAN8Code {
        options[BCKCodeDrawingBarScaleOption] = 2.0
        options[BCKCodeDrawingSizeWidthOption] = 120 // width in points
        options[BCKCodeDrawingSizeHeightOption] = 60  // height in points
            
        // Caption (numbers) font
        options[BCKCodeDrawingCaptionFontNameOption] = "Courier"   // thin/clean font
        options[BCKCodeDrawingCaptionFontPointSizeOption] = 8.0         // font size
            
        // spacing adjustment between barcode and numbers
        options[BCKCodeDrawingMarkerBarsOverlapCaptionPercentOption] = 0.3   // smaller = closer
     
     }

I also noticed that while BCKCodeDrawingCaptionFontNameOption works as expected, BCKCodeDrawingCaptionFontPointSizeOption doesn’t seem to have any effect.

Could you please suggest the correct way to:

  1. Add a top margin to the barcode.
  2. Ensure left and right margins are equal.
  3. Control the caption font size properly.

This is what image I'm getting

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions