Skip to content

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