Skip to content
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

Tell me the structure of the qrtemplate.json file #44

Open
TakNePoidet opened this issue Jun 19, 2024 · 2 comments
Open

Tell me the structure of the qrtemplate.json file #44

TakNePoidet opened this issue Jun 19, 2024 · 2 comments

Comments

@TakNePoidet
Copy link

This one doesn't work

{
  "design": {
    "shape": {
       "eye": "teardrop"
    }
  }
}
.build/release/qrcodegen --style-template-file qrtemplate.json  -t "QRCode on the clipboard" --output-file "fish.png" 1024
@dagronf
Copy link
Owner

dagronf commented Jun 19, 2024

@TakNePoidet hey mate, you can create a template file by saving a QRCode.Document to a file using the .jsonData(). (Unfortunately) there's no way other than code to create one.

There's currently no way to create a template file directly from the command line, however I realise that it makes sense to be able to use the command line to generate a template. I'll add it.

@dagronf
Copy link
Owner

dagronf commented Jun 20, 2024

@TakNePoidet Hey mate - I've just pushed a new version (20.1.0) which includes the ability to generate a style template from the command line.

You can export your QR code to JSON format eg.

.build/debug/qrcodegen -e teardrop -t "QRCode on the clipboard" 512 --output-format json > template.json

You can then use this as the style template for other code generations eg.

.build/release/qrcodegen --style-template-file template.json -t "This is my second QR Code" --output-file "fish.png" 1024

Can you try this out an see how it works for you?

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

No branches or pull requests

2 participants