Comments (9)
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.
Why don't you just use % instead of px?
from php-barcode-generator.
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.
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.
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.
from php-barcode-generator.
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.
Uhm nice approach. You are truly able to "sell" your work.
from php-barcode-generator.
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)
- Inline svg HOT 1
- Not compatible with PHP 73 HOT 1
- thrown in /home/devspedi/public_html/wp-content/themes/additrans/lib/php-barcode-generator/src/BarcodeGenerator.php on line 140 HOT 1
- using FORM as array like name='data[]' HOT 1
- Barcode images not showing in Gmail, tried with PNG and HTML as base64 is not supported HOT 1
- TYPE_EAN_13 Error with 13 numbers HOT 2
- Image not showing when used text and number, but also showing number. HOT 5
- Unable to work with php 8.2 and XAMPP on Windows x64 HOT 1
- PHP 8.2: fix E_DEPRECATED warning HOT 1
- Make $widthFactor to be float HOT 4
- Fatal error: Uncaught Error: Call to undefined function Picqer\Barcode\imagejpeg() HOT 3
- Page autosubmit after scan QR code HOT 2
- Barcode content validation question HOT 2
- Barcodes generated using BarcodeGeneratorDynamicHTML() do not render when printed HOT 1
- Feature Request: Add feature to optionally generate barcodes by width (px) not width factor HOT 18
- Cannot use object of type Picqer\\Barcode\\Barcode as array HOT 1
- Code128 donβt work HOT 2
- No dependencies? HOT 5
- Add background and margin on generated barcode HOT 3
- GTIN14 not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-barcode-generator.