Skip to content

QR Code: add the possibility to set a fixed version #861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

betarho
Copy link

@betarho betarho commented Nov 1, 2024

There are use cases where the generated QR Code must have fixed modules, no matter what the text length is.
These patches add the possibility to explicitly set the QR Code version.
It is the user responsibility to guarantee that the text to be encoded has a length that fits into the selected version.

The patches touch both the MultiFormatWriter and the WriteBarcode "CreateBarcode" methods defined under the ZXing experimental API.
Also the ZXingWriter CLI example program has been updated, adding a new option.

There are use cases where the generated QR Code must have fixed modules,
no matter what the text length is.
In this case, it's up to the user to choose a suitable QR Code version
so that the text to be encoded fits.
Now that the MultiFormatWriter exposed the method to set the QR Code
version, the same possibility has been added to the "CreateBarcode"
methods defined under the ZXing experimental API.
The CLI example program gained the possibility to set the QR Code version
now that both the MultiFormatWriter and the "CreateBarcode" methods
defined under the ZXing experimental API exposed the related method.
@axxel
Copy link
Collaborator

axxel commented Nov 3, 2024

Thanks for your effort. As laid out in #862, I'm considering an alternative approach for adding symbology specific configuration and result meta-information. You are welcome to join the discussion.

@axxel
Copy link
Collaborator

axxel commented Apr 22, 2025

There is progress on the string-based symbology specific parameter front. If you have ZXING_EXPERIMENTAL_API=ON configured, you can call e.g.

ZXingWriter -size 500 microqrcode "1234" -options "version:2,datamask:0" out.png -v

@axxel axxel closed this Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy