Giter VIP home page Giter VIP logo

Comments (9)

casperbakker avatar casperbakker commented on June 6, 2024

The widths are variable because different codes will have different space needs.

Best thing to do is creating a bigger image, then resize it down with GD yourself to the width you need. You can also crop the height after that to make sure you have the same width and height every time.

from php-barcode-generator.

ctrlmaniac avatar ctrlmaniac commented on June 6, 2024

Why don't you just use % instead of px?

from php-barcode-generator.

casperbakker avatar casperbakker commented on June 6, 2024

That is what this code is based on when I forked it and there is no practical reason to change it for now.

from php-barcode-generator.

ctrlmaniac avatar ctrlmaniac commented on June 6, 2024

the practical reason is that right now it has a fixed size. I cannot print it on labes because it's huge. It's even bigger than iphone screens so it's neither mobile friendly. My POS prints label barcode which are 1cm wide. Yours are 5 cm wide. So that's the practical use.

from php-barcode-generator.

casperbakker avatar casperbakker commented on June 6, 2024

Well, in practice this library only generates the image itself. You can embed the image on a HTML page with the img tag, and specify the height and width as you wish and it will reformat the image as needed.

It is even recommended to create a larger image and display it smaller, that way you can print the image with 300 dpi, instead of 72 dpi which will be used when you print an image from the browser directly.

If you really need it as an image, you can also resize it with GD after this library created the image.

So that is why there is no 'practical reason' for this whole library to be changed to work based on percentage then on pixels.

And if you think that is what needs to be done, you are free to fork this library and change it yourself.

from php-barcode-generator.

ctrlmaniac avatar ctrlmaniac commented on June 6, 2024

from php-barcode-generator.

casperbakker avatar casperbakker commented on June 6, 2024

See the Readme for usage and even an example how to embed directly in an image tag.

I am not obliged to do your work. If you think this library is useful to you, you are free to use it. If you think it is complete garbage, that is also fine with me, just build your own.

from php-barcode-generator.

ctrlmaniac avatar ctrlmaniac commented on June 6, 2024

Uhm nice approach. You are truly able to "sell" your work.

from php-barcode-generator.

casperbakker avatar casperbakker commented on June 6, 2024

I am not trying to "sell" this work, you are not able to pay me money for this... We use it ourself and it works like a charm. It is here for anyone else to enjoy. If you do not enjoy it, that is fine with me but just do not tell me what I should do in my free time.

from php-barcode-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.